You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2021/07/14 02:42:03 UTC

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

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



##########
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:
       No, the return logic is in 88 & 89 lines.




-- 
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-unsubscribe@hbase.apache.org

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