saintstack commented on a change in pull request #958: HBASE-23584 : Descrease
rpc getFileStatus count when open a storefile
URL: https://github.com/apache/hbase/pull/958#discussion_r361737911
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileInfo.java
##########
@@ -362,21 +360,23 @@ private HDFSBlocksDistribution
computeHDFSBlocksDistributionInternal(final FileS
return FSUtils.computeHDFSBlocksDistribution(fs, status, 0,
status.getLen());
}
}
-
+
/**
* Get the {@link FileStatus} of the file referenced by this StoreFileInfo
* @param fs The current file system to use.
* @return The {@link FileStatus} of the file referenced by this
StoreFileInfo
*/
public FileStatus getReferencedFileStatus(final FileSystem fs) throws
IOException {
FileStatus status;
+ if(this.localStatus != null) {return this.localStatus;}
Review comment:
Do you think multiple threads will come in h ere at same time? Maybe it
would be better to make localStatus be final and assign it on construction of
this StoreFileInfo? If so, change name localStatus to status?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services