From 2ebf2551ad7123ddfde4a558cfe03b737804be7e Mon Sep 17 00:00:00 2001 From: jhungund <106576553+jhungund@users.noreply.github.com> Date: Wed, 11 Sep 2024 16:10:54 +0530 Subject: [PATCH] HBASE-28804: Implement asynchronous retrieval of bucket-cache data from persistence (#6182) (#6219) The cherry-pick of HBASE-29727 into branch-2.6 accidently brought most of HBASE-28804 into branch-2, this is to backport the remaining original change in HBASE-28804. Signed-off-by: Wellington Chevreuil Change-Id: I816141ccebf91191aaa4cb6afa04343b64663eb0 --- .../org/apache/hadoop/hbase/io/hfile/HFilePreadReader.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePreadReader.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePreadReader.java index bb09b98c39c6..3e2a0fa7d522 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePreadReader.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePreadReader.java @@ -37,6 +37,9 @@ public class HFilePreadReader extends HFileReaderImpl { public HFilePreadReader(ReaderContext context, HFileInfo fileInfo, CacheConfig cacheConf, Configuration conf) throws IOException { super(context, fileInfo, cacheConf, conf); + cacheConf.getBlockCache() + .ifPresent(cache -> cache.waitForCacheInitialization(WAIT_TIME_FOR_CACHE_INITIALIZATION)); + // Initialize HFileInfo object with metadata for caching decisions fileInfo.initMetaAndIndex(this); // master hosted regions, like the master procedures store wouldn't have a block cache