Skip to content

Commit

Permalink
HBASE-26083 In branch-2 & branch-1 L1 miss metric is always 0 when us…
Browse files Browse the repository at this point in the history
…ing CombinedBlockCache (#3473)

Signed-off-by Anoop Sam John <[email protected]>
Signed-off-by Reid Chan <[email protected]>
  • Loading branch information
YutSean authored Jul 16, 2021
1 parent 287cf20 commit fb01a6c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 && !repeat) {
// If the block does not exist in L1, the containsBlock should be counted as one miss.
l1Cache.getStats().miss(caching, cacheKey.isPrimary(), cacheKey.getBlockType());
}

return existInL1 ?
l1Cache.getBlock(cacheKey, caching, repeat, updateCacheMetrics):
l2Cache.getBlock(cacheKey, caching, repeat, updateCacheMetrics);
}
Expand Down

0 comments on commit fb01a6c

Please sign in to comment.