sandeepvinayak opened a new pull request #856: Optimizing calls to 
setStoragePolicy
URL: https://github.com/apache/hbase/pull/856
 
 
   In CommonFSUtils's ` invokeSetStoragePolicy(final FileSystem fs, final Path 
path,
         final String storagePolicy)`, we invoke the setStoragePolicy by the 
following:
   
   ```java
   m = fs.getClass().getDeclaredMethod("setStoragePolicy",
           new Class<?>[] { Path.class, String.class });
   ...
   m.invoke(fs, path, storagePolicy);
   ```
   
   When the call is initiated by HRegionFileSystem and fs is HFileSystem, 
`m.invoke(fs, path, storagePolicy)`repeats the same function call 
`setStoragePolicy(final FileSystem fs, final Path path,
         final String storagePolicy)` with underneath file system. 
   
   We can avoid this duplicate calls by checking in advance if the file system 
for HRegionFileSystem is HFileSystem call the setStoragePolicy with the 
underneath fs. 

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