[GitHub] [hbase] Reidddddd commented on a change in pull request #3473: HBASE-26083 In branch-2 & branch-1 L1 miss metric is always 0 when using CombinedBlockCache

2021-07-13 Thread GitBox


Reidd commented on a change in pull request #3473:
URL: https://github.com/apache/hbase/pull/3473#discussion_r669262896



##
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CombinedBlockCache.java
##
@@ -78,7 +78,13 @@ public Cacheable getBlock(BlockCacheKey cacheKey, boolean 
caching,
 // we end up calling l2Cache.getBlock.
 // We are not in a position to exactly look at LRU cache or BC as 
BlockType may not be getting
 // passed always.
-return l1Cache.containsBlock(cacheKey)?
+boolean existInL1 = l1Cache.containsBlock(cacheKey);
+if (!existInL1 && updateCacheMetrics) {
+  // If the block does not exist in L1, the containsBlock should be 
counted as one miss.
+  l1Cache.getStats().miss(false, cacheKey.isPrimary(), 
cacheKey.getBlockType());

Review comment:
   not `false` here, should pass the `caching` parameter.




-- 
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




[GitHub] [hbase] Reidddddd commented on a change in pull request #3473: HBASE-26083 In branch-2 & branch-1 L1 miss metric is always 0 when using CombinedBlockCache

2021-07-13 Thread GitBox


Reidd commented on a change in pull request #3473:
URL: https://github.com/apache/hbase/pull/3473#discussion_r669233258



##
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CombinedBlockCache.java
##
@@ -78,7 +78,13 @@ public Cacheable getBlock(BlockCacheKey cacheKey, boolean 
caching,
 // we end up calling l2Cache.getBlock.
 // We are not in a position to exactly look at LRU cache or BC as 
BlockType may not be getting
 // passed always.
-return l1Cache.containsBlock(cacheKey)?
+boolean existInL1 = l1Cache.containsBlock(cacheKey);
+if (!existInL1 && updateCacheMetrics) {
+  // If the block does not exist in L1, the containsBlock should be 
counted as one miss.
+  l1Cache.getStats().miss(false, cacheKey.isPrimary(), 
cacheKey.getBlockType());
+}
+
+return existInL1?

Review comment:
   Doesn't the logic become different? The original version will still 
getBlock from L2, but yours just return existInL1?
   I don't get it here.




-- 
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