| Package | Description | 
|---|---|
| org.apache.hadoop.hbase.io.hfile | Provides implementations of  HFileand HFileBlockCache. | 
| org.apache.hadoop.hbase.io.hfile.bucket | Provides  BucketCache, an implementation ofBlockCache. | 
| Modifier and Type | Field and Description | 
|---|---|
| private BlockCacheKey | LruCachedBlock. cacheKey | 
| private BlockCacheKey | TinyLfuBlockCache.CachedBlockView. key | 
| Modifier and Type | Field and Description | 
|---|---|
| (package private) com.github.benmanes.caffeine.cache.Cache<BlockCacheKey,Cacheable> | TinyLfuBlockCache. cache | 
| private ConcurrentHashMap<BlockCacheKey,LruCachedBlock> | LruBlockCache. mapDefined the cache map as  ConcurrentHashMaphere, because inLruBlockCache.getBlock(org.apache.hadoop.hbase.io.hfile.BlockCacheKey, boolean, boolean, boolean), we need to guarantee the atomicity of map#computeIfPresent
 (key, func). | 
| private com.github.benmanes.caffeine.cache.Policy.Eviction<BlockCacheKey,Cacheable> | TinyLfuBlockCache. policy | 
| Modifier and Type | Method and Description | 
|---|---|
| BlockCacheKey | LruCachedBlock. getCacheKey() | 
| Modifier and Type | Method and Description | 
|---|---|
| (package private) Map<BlockCacheKey,LruCachedBlock> | LruBlockCache. getMapForTests() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | LruBlockCache. cacheBlock(BlockCacheKey cacheKey,
          Cacheable buf)Cache the block with the specified name and buffer. | 
| void | BlockCache. cacheBlock(BlockCacheKey cacheKey,
          Cacheable buf)Add block to cache (defaults to not in-memory). | 
| void | TinyLfuBlockCache. cacheBlock(BlockCacheKey key,
          Cacheable value) | 
| void | CombinedBlockCache. cacheBlock(BlockCacheKey cacheKey,
          Cacheable buf) | 
| void | MemcachedBlockCache. cacheBlock(BlockCacheKey cacheKey,
          Cacheable buf) | 
| void | LruBlockCache. cacheBlock(BlockCacheKey cacheKey,
          Cacheable buf,
          boolean inMemory)Cache the block with the specified name and buffer. | 
| void | BlockCache. cacheBlock(BlockCacheKey cacheKey,
          Cacheable buf,
          boolean inMemory)Add block to cache. | 
| void | TinyLfuBlockCache. cacheBlock(BlockCacheKey cacheKey,
          Cacheable value,
          boolean inMemory) | 
| void | CombinedBlockCache. cacheBlock(BlockCacheKey cacheKey,
          Cacheable buf,
          boolean inMemory) | 
| void | InclusiveCombinedBlockCache. cacheBlock(BlockCacheKey cacheKey,
          Cacheable buf,
          boolean inMemory) | 
| void | MemcachedBlockCache. cacheBlock(BlockCacheKey cacheKey,
          Cacheable buf,
          boolean inMemory) | 
| boolean | LruBlockCache. containsBlock(BlockCacheKey cacheKey)Whether the cache contains block with specified cacheKey | 
| boolean | FirstLevelBlockCache. containsBlock(BlockCacheKey cacheKey)Whether the cache contains the block with specified cacheKey | 
| boolean | TinyLfuBlockCache. containsBlock(BlockCacheKey cacheKey) | 
| boolean | LruBlockCache. evictBlock(BlockCacheKey cacheKey) | 
| boolean | BlockCache. evictBlock(BlockCacheKey cacheKey)Evict block from cache. | 
| boolean | TinyLfuBlockCache. evictBlock(BlockCacheKey cacheKey) | 
| boolean | CombinedBlockCache. evictBlock(BlockCacheKey cacheKey) | 
| boolean | InclusiveCombinedBlockCache. evictBlock(BlockCacheKey cacheKey) | 
| boolean | MemcachedBlockCache. evictBlock(BlockCacheKey cacheKey) | 
| Cacheable | LruBlockCache. getBlock(BlockCacheKey cacheKey,
        boolean caching,
        boolean repeat,
        boolean updateCacheMetrics)Get the buffer of the block with the specified name. | 
| Cacheable | BlockCache. getBlock(BlockCacheKey cacheKey,
        boolean caching,
        boolean repeat,
        boolean updateCacheMetrics)Fetch block from cache. | 
| Cacheable | TinyLfuBlockCache. getBlock(BlockCacheKey cacheKey,
        boolean caching,
        boolean repeat,
        boolean updateCacheMetrics) | 
| Cacheable | CombinedBlockCache. getBlock(BlockCacheKey cacheKey,
        boolean caching,
        boolean repeat,
        boolean updateCacheMetrics) | 
| Cacheable | InclusiveCombinedBlockCache. getBlock(BlockCacheKey cacheKey,
        boolean caching,
        boolean repeat,
        boolean updateCacheMetrics) | 
| Cacheable | MemcachedBlockCache. getBlock(BlockCacheKey cacheKey,
        boolean caching,
        boolean repeat,
        boolean updateCacheMetrics) | 
| private HFileBlock | HFileReaderImpl. getCachedBlock(BlockCacheKey cacheKey,
              boolean cacheBlock,
              boolean useLock,
              boolean isCompaction,
              boolean updateCacheMetrics,
              BlockType expectedBlockType,
              DataBlockEncoding expectedDataBlockEncoding)Retrieve block from cache. | 
| int | CombinedBlockCache. getRpcRefCount(BlockCacheKey cacheKey) | 
| void | TinyLfuBlockCache.EvictionListener. onRemoval(BlockCacheKey key,
         Cacheable value,
         com.github.benmanes.caffeine.cache.RemovalCause cause) | 
| private void | HFileReaderImpl. returnAndEvictBlock(BlockCache cache,
                   BlockCacheKey cacheKey,
                   Cacheable block) | 
| static boolean | BlockCacheUtil. shouldReplaceExistingCacheBlock(BlockCache blockCache,
                               BlockCacheKey cacheKey,
                               Cacheable newBlock)Because of the region splitting, it's possible that the split key locate in the middle of a
 block. | 
| static int | BlockCacheUtil. validateBlockAddition(Cacheable existing,
                     Cacheable newBlock,
                     BlockCacheKey cacheKey)Validate that the existing and newBlock are the same without including the nextBlockMetadata,
 if not, throw an exception. | 
| Constructor and Description | 
|---|
| CachedBlockView(BlockCacheKey key,
               Cacheable value,
               long now) | 
| LruCachedBlock(BlockCacheKey cacheKey,
              Cacheable buf,
              long accessTime) | 
| LruCachedBlock(BlockCacheKey cacheKey,
              Cacheable buf,
              long accessTime,
              boolean inMemory) | 
| Modifier and Type | Field and Description | 
|---|---|
| private BlockCacheKey | BucketCache.RAMQueueEntry. key | 
| Modifier and Type | Field and Description | 
|---|---|
| (package private) ConcurrentHashMap<BlockCacheKey,BucketEntry> | BucketCache. backingMap | 
| private NavigableSet<BlockCacheKey> | BucketCache. blocksByHFile | 
| private static Comparator<Map.Entry<BlockCacheKey,BucketEntry>> | CachedEntryQueue. COMPARATOR | 
| (package private) ConcurrentHashMap<BlockCacheKey,BucketCache.RAMQueueEntry> | BucketCache.RAMCache. delegateDefined the map as  ConcurrentHashMapexplicitly here, because inBucketCache.RAMCache.get(BlockCacheKey)andBucketCache.RAMCache.putIfAbsent(BlockCacheKey, BucketCache.RAMQueueEntry), we need to
 guarantee the atomicity of map#computeIfPresent(key, func) and map#putIfAbsent(key, func). | 
| private org.apache.hbase.thirdparty.com.google.common.collect.MinMaxPriorityQueue<Map.Entry<BlockCacheKey,BucketEntry>> | CachedEntryQueue. queue | 
| Modifier and Type | Method and Description | 
|---|---|
| BlockCacheKey | BucketCache.RAMQueueEntry. getKey() | 
| Modifier and Type | Method and Description | 
|---|---|
| (package private) static ConcurrentHashMap<BlockCacheKey,BucketEntry> | BucketProtoUtils. fromPB(Map<Integer,String> deserializers,
      org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMap backingMap) | 
| Map.Entry<BlockCacheKey,BucketEntry> | CachedEntryQueue. poll() | 
| Map.Entry<BlockCacheKey,BucketEntry> | CachedEntryQueue. pollLast() | 
| Modifier and Type | Method and Description | 
|---|---|
| (package private) void | BucketCache. blockEvicted(BlockCacheKey cacheKey,
            BucketEntry bucketEntry,
            boolean decrementBlockNumber) | 
| void | BucketCache. cacheBlock(BlockCacheKey cacheKey,
          Cacheable buf)Cache the block with the specified name and buffer. | 
| void | BucketCache. cacheBlock(BlockCacheKey cacheKey,
          Cacheable cachedItem,
          boolean inMemory)Cache the block with the specified name and buffer. | 
| void | BucketCache. cacheBlockWithWait(BlockCacheKey cacheKey,
                  Cacheable cachedItem,
                  boolean inMemory,
                  boolean wait)Cache the block to ramCache | 
| private void | BucketCache. cacheBlockWithWaitInternal(BlockCacheKey cacheKey,
                          Cacheable cachedItem,
                          boolean inMemory,
                          boolean wait) | 
| boolean | BucketCache.RAMCache. containsKey(BlockCacheKey key) | 
| private ByteBuffAllocator.Recycler | BucketCache. createRecycler(BlockCacheKey cacheKey) | 
| boolean | BucketCache. evictBlock(BlockCacheKey cacheKey)Try to evict the block from  BlockCacheby force. | 
| BucketCache.RAMQueueEntry | BucketCache.RAMCache. get(BlockCacheKey key) | 
| Cacheable | BucketCache. getBlock(BlockCacheKey key,
        boolean caching,
        boolean repeat,
        boolean updateCacheMetrics)Get the buffer of the block with the specified key. | 
| int | BucketCache. getRpcRefCount(BlockCacheKey cacheKey) | 
| BucketCache.RAMQueueEntry | BucketCache.RAMCache. putIfAbsent(BlockCacheKey key,
           BucketCache.RAMQueueEntry entry)Return the previous associated value, or null if absent. | 
| private void | BucketCache.WriterThread. putIntoBackingMap(BlockCacheKey key,
                 BucketEntry bucketEntry)Put the new bucket entry into backingMap. | 
| boolean | BucketCache.RAMCache. remove(BlockCacheKey key) | 
| boolean | BucketCache.RAMCache. remove(BlockCacheKey key,
      Consumer<BucketCache.RAMQueueEntry> action)Defined an  Consumerhere, because once the removed entry release its reference count,
 then it's ByteBuffers may be recycled and accessing it outside this method will be thrown an
 exception. | 
| private boolean | BucketCache. removeFromRamCache(BlockCacheKey cacheKey) | 
| private static org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BlockCacheKey | BucketProtoUtils. toPB(BlockCacheKey key) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | CachedEntryQueue. add(Map.Entry<BlockCacheKey,BucketEntry> entry)Attempt to add the specified entry to this queue. | 
| void | BucketCache.BucketEntryGroup. add(Map.Entry<BlockCacheKey,BucketEntry> block) | 
| private static org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMap | BucketProtoUtils. toPB(Map<BlockCacheKey,BucketEntry> backingMap) | 
| Constructor and Description | 
|---|
| RAMQueueEntry(BlockCacheKey bck,
             Cacheable data,
             long accessCounter,
             boolean inMemory,
             ByteBuffAllocator.Recycler recycler) | 
| Constructor and Description | 
|---|
| BucketAllocator(long availableSpace,
               int[] bucketSizes,
               Map<BlockCacheKey,BucketEntry> map,
               LongAdder realCacheSize)Rebuild the allocator's data structures from a persisted map. | 
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.