saintstack commented on a change in pull request #1380: HBASE-23584 : Descrease 
rpc getFileStatus count when open a storefile
URL: https://github.com/apache/hbase/pull/1380#discussion_r400991200
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileInfo.java
 ##########
 @@ -155,18 +157,60 @@ private StoreFileInfo(final Configuration conf, final 
FileSystem fs, final FileS
     } else if (isHFile(p) || isMobFile(p) || isMobRefFile(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();
+        this.localStatus = fileStatus;
+      }else{
+        this.localStatus = loadAndCacheFileStatus(fs);
       }
+      this.createdTimestamp = localStatus.getModificationTime();
+      this.size = localStatus.getLen();
       this.reference = null;
       this.link = null;
     } else {
       throw new IOException("path=" + p + " doesn't look like a valid 
StoreFile");
     }
+    if(this.localStatus == null ){
 
 Review comment:
   See how spacing is done in rest of the file.

----------------------------------------------------------------
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

Reply via email to