diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java index 07ff1894781..ec17f4fa477 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java @@ -1338,7 +1338,8 @@ public abstract class HFileReaderImpl implements HFile.Reader, Configurable { cacheConf.getBlockCache().ifPresent(cache -> { if (cacheBlock && cacheConf.shouldCacheBlockOnRead(category)) { // Using the wait on cache during compaction and prefetching. - cache.cacheBlock(cacheKey, cacheCompressed ? hfileBlock : unpacked, cacheOnly); + cache.cacheBlock(cacheKey, cacheCompressed ? hfileBlock : unpacked, + cacheConf.isInMemory(), cacheOnly); } }); if (unpacked != hfileBlock) {