HuiHang-Yu 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_r401420441
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileInfo.java
 ##########
 @@ -350,49 +393,18 @@ private HDFSBlocksDistribution 
computeHDFSBlocksDistributionInternal(final FileS
     }
   }
 
+
+
   /**
    * 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.reference != null) {
-      if (this.link != null) {
-        FileNotFoundException exToThrow = null;
-        for (int i = 0; i < this.link.getLocations().length; i++) {
-          // HFileLink Reference
-          try {
-            return link.getFileStatus(fs);
-          } catch (FileNotFoundException ex) {
-            // try the other location
-            exToThrow = ex;
-          }
-        }
-        throw exToThrow;
-      } else {
-        // HFile Reference
-        Path referencePath = getReferredToFile(this.getPath());
-        status = fs.getFileStatus(referencePath);
-      }
-    } else {
-      if (this.link != null) {
-        FileNotFoundException exToThrow = null;
-        for (int i = 0; i < this.link.getLocations().length; i++) {
-          // HFileLink
-          try {
-            return link.getFileStatus(fs);
-          } catch (FileNotFoundException ex) {
-            // try the other location
-            exToThrow = ex;
-          }
-        }
-        throw exToThrow;
-      } else {
-        status = fs.getFileStatus(initialPath);
-      }
+    if(null == this.localStatus){
+      throw new IOException("localStatus is not initialize on construct");
 
 Review comment:
   ClassName may be added when IOException is thrown later in stack infomation 
, i think .

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