Class BucketCache

java.lang.Object
org.apache.hadoop.hbase.io.hfile.bucket.BucketCache
All Implemented Interfaces:
Iterable<CachedBlock>, HeapSize, BlockCache

@Private public class BucketCache extends Object implements BlockCache, HeapSize
BucketCache uses BucketAllocator to allocate/free blocks, and uses BucketCache#ramCache and BucketCache#backingMap in order to determine if a given element is in the cache. The bucket cache can use off-heap memory ByteBufferIOEngine or mmap ExclusiveMemoryMmapIOEngine or pmem SharedMemoryMmapIOEngine or local files FileIOEngine to store/read the block data.

Eviction is via a similar algorithm as used in LruBlockCache

BucketCache can be used as mainly a block cache (see CombinedBlockCache), combined with a BlockCache to decrease CMS GC and heap fragmentation.

It also can be used as a secondary cache (e.g. using a file on ssd/fusionio to store blocks) to enlarge cache space via a victim cache.