virajjasani commented on a change in pull request #1074: HBASE-23350 Make 
compaction files cacheonWrite configurable based on threshold
URL: https://github.com/apache/hbase/pull/1074#discussion_r368722533
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java
 ##########
 @@ -412,6 +447,19 @@ public ByteBuffAllocator getByteBuffAllocator() {
     return this.byteBuffAllocator;
   }
 
+  private long getCacheCompactedBlocksOnWriteThreshold(Configuration conf) {
+    long cacheCompactedBlocksOnWriteThreshold = 
conf.getLong(CACHE_COMPACTED_BLOCKS_ON_WRITE_THRESHOLD_KEY,
+      DEFAULT_CACHE_COMPACTED_BLOCKS_ON_WRITE_THRESHOLD);
+
+    if (cacheCompactedBlocksOnWriteThreshold < 0) {
+      LOG.warn("cacheCompactedBlocksOnWriteThreshold value :" + 
cacheCompactedBlocksOnWriteThreshold
+        + "is less than 0, resetting it to: " + 
DEFAULT_CACHE_COMPACTED_BLOCKS_ON_WRITE_THRESHOLD);
 
 Review comment:
   We can use Log with {} for arguments similar to other usecases:
   ```
   LOG.warn("cacheCompactedBlocksOnWriteThreshold value : {} is less than 0, 
resetting it to: ", cacheCompactedBlocksOnWriteThreshold)
   ```

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to