HBASE-27365 Minimise block addition failures due to no space in bucket cache writers queue by introducing wait time-addendum

This commit is contained in:
Rajeshbabu Chintaguntla 2022-10-05 04:29:31 +05:30
parent 108479e95e
commit 0566f0cca5

View File

@ -53,11 +53,17 @@ public class CombinedBlockCache implements ResizableBlockCache, HeapSize {
@Override
public void cacheBlock(BlockCacheKey cacheKey, Cacheable buf, boolean inMemory) {
boolean metaBlock = buf.getBlockType().getCategory() != BlockType.BlockCategory.DATA;
cacheBlock(cacheKey, buf, inMemory, false);
}
@Override
public void cacheBlock(BlockCacheKey cacheKey, Cacheable buf, boolean inMemory,
boolean waitWhenCache) {
boolean metaBlock = isMetaBlock(buf.getBlockType());
if (metaBlock) {
l1Cache.cacheBlock(cacheKey, buf, inMemory);
} else {
l2Cache.cacheBlock(cacheKey, buf, inMemory);
l2Cache.cacheBlock(cacheKey, buf, inMemory, waitWhenCache);
}
}