anoopsjohn commented on a change in pull request #948: HBASE-23588 : Cache 
index & bloom blocks on write if CacheCompactedBl…
URL: https://github.com/apache/hbase/pull/948#discussion_r363027458
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
 ##########
 @@ -1120,9 +1120,25 @@ public StoreFileWriter createWriterInTmp(long 
maxKeyCount, Compression.Algorithm
     if (isCompaction) {
       // Don't cache data on write on compactions, unless specifically 
configured to do so
       writerCacheConf = new CacheConfig(cacheConf);
-      
writerCacheConf.setCacheDataOnWrite(cacheConf.shouldCacheCompactedBlocksOnWrite());
+      final boolean shouldCacheCompactedBlocksOnWrite = cacheConf
+        .shouldCacheCompactedBlocksOnWrite();
+      // if data blocks are to be cached on write during compaction, we should
+      // forcefully cache index and bloom blocks as well
+      if (shouldCacheCompactedBlocksOnWrite) {
+        writerCacheConf.enableCacheOnWrite();
+        LOG.info("cacheCompactedBlocksOnWrite is true, hence enabled 
cacheOnWrite for " +
 
 Review comment:
   IMHO this will create so much INFO log each of which wont be giving much 
meaningful info later. No info which file being written.  At the RS level we 
can log once in INFO level that because of enableCacheOnCompaction is true, we 
make all 3 to true. But now it will be logged for each and every flush and 
compaction.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to