HBASE-16651 LRUBlockCache#returnBlock should try return block to Victim Handler L2 cache.
This commit is contained in:
parent
c9d0d11e18
commit
19bbf44554
|
@ -358,8 +358,7 @@ public class CombinedBlockCache implements ResizableBlockCache, HeapSize {
|
|||
|
||||
@Override
|
||||
public void returnBlock(BlockCacheKey cacheKey, Cacheable block) {
|
||||
// A noop
|
||||
this.lruCache.returnBlock(cacheKey, block);
|
||||
// returnBlock is meaningful for L2 cache alone.
|
||||
this.l2Cache.returnBlock(cacheKey, block);
|
||||
}
|
||||
|
||||
|
|
|
@ -1156,6 +1156,13 @@ public class LruBlockCache implements ResizableBlockCache, HeapSize {
|
|||
|
||||
@Override
|
||||
public void returnBlock(BlockCacheKey cacheKey, Cacheable block) {
|
||||
// There is no SHARED type here. Just return
|
||||
// There is no SHARED type here in L1. But the block might have been served from the Victim
|
||||
// handler L2 cache. (when the Combined mode = false). So just try return this block to
|
||||
// L2 victim handler cache.
|
||||
// Note : In case of CombinedBlockCache, we will have this victimHandler configured for L1
|
||||
// cache. But CombinedBlockCache will only call returnBlock on L2 cache.
|
||||
if (this.victimHandler != null) {
|
||||
this.victimHandler.returnBlock(cacheKey, block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue