jhungund commented on code in PR #5905:
URL: https://github.com/apache/hbase/pull/5905#discussion_r1602908275
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java:
##########
@@ -1357,9 +1357,16 @@ public HFileBlock readBlock(long dataBlockOffset, long
onDiskBlockSize, final bo
BlockType.BlockCategory category =
hfileBlock.getBlockType().getCategory();
final boolean cacheCompressed =
cacheConf.shouldCacheCompressed(category);
final boolean cacheOnRead = cacheConf.shouldCacheBlockOnRead(category);
+ Optional<Boolean> cacheFileBlock = Optional.of(true);
+ // Additionally perform the time-based priority checks to see
+ // whether, or not to cache the block.
+ if (cacheConf.getBlockCache().isPresent()) {
+ cacheFileBlock =
cacheConf.getBlockCache().get().shouldCacheFile(getHFileInfo(), conf);
+ }
+ final boolean shouldCacheFileBlock = cacheFileBlock.get();
Review Comment:
This API shouldCacheBlockOnRead, is used at multiple places and takes only
one argument (category). If I move the logic to this function, I will have to
additionally pass these two arguments (getHFileInfo(), conf) to all usages.
Hence, I will work on creating a new API within CacheConfig which internally
checks for the data hotness and returns whether or not, to cache the file block.
--
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]