saintstack commented on a change in pull request #3596:
URL: https://github.com/apache/hbase/pull/3596#discussion_r695991601
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileInfo.java
##########
@@ -163,22 +168,57 @@ private StoreFileInfo(final Configuration conf, final
FileSystem fs, final FileS
}
LOG.trace("{} is a {} reference to {}", p, reference.getFileRegion(),
referencePath);
} else if (isHFile(p)) {
- // HFile
- if (fileStatus != null) {
- this.createdTimestamp = fileStatus.getModificationTime();
- this.size = fileStatus.getLen();
- } else {
- FileStatus fStatus = fs.getFileStatus(initialPath);
- this.createdTimestamp = fStatus.getModificationTime();
- this.size = fStatus.getLen();
- }
+ // If a fileStatus, use it. It is pointed at the hfile, not at a link or
reference.
+ this.cachedFileStatus = fileStatus != null? fileStatus:
fs.getFileStatus(p);
+ this.createdTimestamp = this.cachedFileStatus.getModificationTime();
+ this.size = this.cachedFileStatus.getLen();
this.reference = null;
this.link = null;
} else {
throw new IOException("path=" + p + " doesn't look like a valid
StoreFile");
}
}
+ /**
+ * @return A new FNFE with <param>fnfe</param> as cause but including info
if reference or link.
+ */
+ private FileNotFoundException
decorateFileNotFoundException(FileNotFoundException fnfe) {
+ FileNotFoundException newFnfe = new FileNotFoundException(toString());
+ newFnfe.initCause(fnfe);
+ return newFnfe;
+ }
+
+ /**
+ * @return FileStatus for the linked or referenced file or if not a
reference, then the hfile
+ */
+ private FileStatus loadFileStatus(final FileSystem fs) throws IOException {
Review comment:
Let me fix.
--
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]