@Override public void returnBlock(BlockCacheKey cacheKey, Cacheable block) { // returnBlock is meaningful for L2 cache alone. this.l2Cache.returnBlock(cacheKey, block); }
blockCache.returnBlock(cacheKey, existingBlock);
@Override public void returnBlock(HFileBlock block) { if (block != null) { this.cacheConf.getBlockCache().ifPresent(blockCache -> { BlockCacheKey cacheKey = new BlockCacheKey(this.getFileContext().getHFileName(), block.getOffset(), this.isPrimaryReplicaReader(), block.getBlockType()); blockCache.returnBlock(cacheKey, block); }); } }
public static void getBlockAndAssertEquals(BlockCache cache, BlockCacheKey key, Cacheable blockToCache, ByteBuffer destBuffer, ByteBuffer expectedBuffer) { destBuffer.clear(); cache.cacheBlock(key, blockToCache); Cacheable actualBlock = cache.getBlock(key, false, false, false); actualBlock.serialize(destBuffer, true); assertEquals(expectedBuffer, destBuffer); cache.returnBlock(key, actualBlock); } }
cache.returnBlock(cacheKey, compressedBlock); cache.returnBlock(cacheKey, cachedBlock); cache.evictBlock(cacheKey);
blockCache.returnBlock(blockCacheKey, hFileBlock); if(cacheCompressedData) { if (this.compress == Compression.Algorithm.NONE || cowType == CacheOnWriteType.INDEX_BLOCKS || cowType == CacheOnWriteType.BLOOM_BLOCKS) { blockCache.returnBlock(blockCacheKey, hFileBlock); blockCache.returnBlock(blockCacheKey, hFileBlock);
public static void getBlockAndAssertEquals(BlockCache cache, BlockCacheKey key, Cacheable blockToCache, ByteBuffer destBuffer, ByteBuffer expectedBuffer) { destBuffer.clear(); cache.cacheBlock(key, blockToCache); Cacheable actualBlock = cache.getBlock(key, false, false, false); actualBlock.serialize(destBuffer, true); assertEquals(expectedBuffer, destBuffer); cache.returnBlock(key, actualBlock); } }
blockCache.returnBlock(blockCacheKey, hFileBlock); if(cacheCompressedData) { if (this.compress == Compression.Algorithm.NONE || cowType == CacheOnWriteType.INDEX_BLOCKS || cowType == CacheOnWriteType.BLOOM_BLOCKS) { blockCache.returnBlock(blockCacheKey, hFileBlock); blockCache.returnBlock(blockCacheKey, hFileBlock);