HBASE-26083 L1 miss metric is incorrect when using CombinedBlockCache (#3491)
Signed-off-by Anoop Sam John <anoopsamjohn@apache.org> Signed-off-by Reid Chan <reidchan@apache.org>
This commit is contained in:
parent
0836695459
commit
3666357ba0
|
@ -82,7 +82,12 @@ public class CombinedBlockCache implements ResizableBlockCache, HeapSize {
|
||||||
// we end up calling l2Cache.getBlock.
|
// 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
|
// We are not in a position to exactly look at LRU cache or BC as BlockType may not be getting
|
||||||
// passed always.
|
// 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):
|
l1Cache.getBlock(cacheKey, caching, repeat, updateCacheMetrics):
|
||||||
l2Cache.getBlock(cacheKey, caching, repeat, updateCacheMetrics);
|
l2Cache.getBlock(cacheKey, caching, repeat, updateCacheMetrics);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue