taklwu commented on code in PR #8851:
URL: https://github.com/apache/hbase/pull/8851#discussion_r4698625132
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileInfo.java:
##########
@@ -361,24 +400,56 @@ ReaderContext createReaderContext(boolean doDropBehind,
long readahead, ReaderTy
newFnfe.initCause(fnfe);
throw newFnfe;
}
- status = fs.getFileStatus(referencePath);
- } else {
- in = new FSDataInputStreamWrapper(fs, this.getPath(), doDropBehind,
readahead);
- status = fs.getFileStatus(initialPath);
- }
- long length = status.getLen();
- ReaderContextBuilder contextBuilder =
- new
ReaderContextBuilder().withInputStreamWrapper(in).withFileSize(length)
-
.withPrimaryReplicaReader(this.primaryReplica).withReaderType(type).withFileSystem(fs)
-
.withSystemKeyCache(systemKeyCache).withManagedKeyDataCache(managedKeyDataCache);
- if (this.reference != null) {
- contextBuilder.withFilePath(this.getPath());
+ FileStatus refStatus = fs.getFileStatus(referencePath);
+ readerPath = this.getPath();
+ length = refStatus.getLen();
Review Comment:
This does not change the original behavior, but yeah, it seems confusing.
In the previous code, at lines 374–375 and passed this.getPath() to
ReaderContext for file with reference (this.reference != null), meanwhile
passing status.getPath() at line 377 was only used for non-reference files.
In the current code, when it's file with reference (this.reference != null),
readerPath = this.getPath() which is no change. When it's non-reference file
with `statusForOpen` file, we pass `statusForOpen.getPath()` for the new logic.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]