vinayakphegde commented on code in PR #5808:
URL: https://github.com/apache/hbase/pull/5808#discussion_r1570896489


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePreadReader.java:
##########
@@ -37,10 +37,15 @@ public class HFilePreadReader extends HFileReaderImpl {
   public HFilePreadReader(ReaderContext context, HFileInfo fileInfo, 
CacheConfig cacheConf,
     Configuration conf) throws IOException {
     super(context, fileInfo, cacheConf, conf);
+
     final MutableBoolean shouldCache = new MutableBoolean(true);
 
+    // Initialize HFileInfo object with metadata for caching decisions
+    HFileInfo hFileInfoForCaching = new HFileInfo(context, conf);
+    hFileInfoForCaching.initMetaAndIndex(this);

Review Comment:
   > maybe we could modify initMetaAndIndex to do its stuff just if the file 
info hasn't been initialized yet
   Hmmm, I'm not sure how we can do that. Maybe use a boolean field in the 
HFileInfo to track whether initMetaAndIndex is done or not? Because 
initMetaAndIndex does a couple of things, and it's hard to say whether that is 
initialized or not. Can you think of any way we can achieve that?



##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePreadReader.java:
##########
@@ -37,10 +37,15 @@ public class HFilePreadReader extends HFileReaderImpl {
   public HFilePreadReader(ReaderContext context, HFileInfo fileInfo, 
CacheConfig cacheConf,
     Configuration conf) throws IOException {
     super(context, fileInfo, cacheConf, conf);
+
     final MutableBoolean shouldCache = new MutableBoolean(true);
 
+    // Initialize HFileInfo object with metadata for caching decisions
+    HFileInfo hFileInfoForCaching = new HFileInfo(context, conf);
+    hFileInfoForCaching.initMetaAndIndex(this);

Review Comment:
   > maybe we could modify initMetaAndIndex to do its stuff just if the file 
info hasn't been initialized yet.
   
   Hmmm, I'm not sure how we can do that. Maybe use a boolean field in the 
HFileInfo to track whether initMetaAndIndex is done or not? Because 
initMetaAndIndex does a couple of things, and it's hard to say whether that is 
initialized or not. Can you think of any way we can achieve that?



-- 
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: issues-unsubscr...@hbase.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to