wchevreuil commented on code in PR #8353:
URL: https://github.com/apache/hbase/pull/8353#discussion_r3413458294


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCacheKey.java:
##########
@@ -115,7 +114,7 @@ public BlockCacheKey(String hfileName, String cfName, 
String regionName, long of
   public BlockCacheKey(Path hfilePath, long offset, boolean isPrimaryReplica, 
BlockType blockType) {
     this(hfilePath.getName(), hfilePath.getParent().getName(),
       hfilePath.getParent().getParent().getName(), offset, isPrimaryReplica, 
blockType,
-      HFileArchiveUtil.isHFileArchived(hfilePath));

Review Comment:
   We are actually only using this constructor on tests now. Because the 
HFileUtils.isArchived call seems too expensive to be performed on every block 
cache key creation, that check should be delegated to the reader, which can do 
it once during it's initialisation. Writers don't even need it, since a being 
written file is guaranteed to be "non-archived", so writers can benefit from 
constructors that alwas set archived as false. Let me add javadoc to explain 
this.



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

Reply via email to