Uses of Class
org.apache.hadoop.hbase.io.hfile.BlockCacheKey
Package
Description
Provides implementations of
HFile
and HFile
BlockCache
.Provides
BucketCache
, an implementation of
BlockCache
.-
Uses of BlockCacheKey in org.apache.hadoop.hbase.io.hfile
Modifier and TypeFieldDescriptionprivate final BlockCacheKey
LruCachedBlock.cacheKey
private final BlockCacheKey
TinyLfuBlockCache.CachedBlockView.key
Modifier and TypeFieldDescription(package private) final com.github.benmanes.caffeine.cache.Cache<BlockCacheKey,
Cacheable> TinyLfuBlockCache.cache
private final ConcurrentHashMap<BlockCacheKey,
LruCachedBlock> LruAdaptiveBlockCache.map
Defined the cache map asConcurrentHashMap
here, because inLruAdaptiveBlockCache.getBlock(org.apache.hadoop.hbase.io.hfile.BlockCacheKey, boolean, boolean, boolean)
, we need to guarantee the atomicity of map#computeIfPresent (key, func).private final ConcurrentHashMap<BlockCacheKey,
LruCachedBlock> LruBlockCache.map
Defined the cache map asConcurrentHashMap
here, because inLruBlockCache.getBlock(org.apache.hadoop.hbase.io.hfile.BlockCacheKey, boolean, boolean, boolean)
, we need to guarantee the atomicity of map#k (key, func).private final com.github.benmanes.caffeine.cache.Policy.Eviction<BlockCacheKey,
Cacheable> TinyLfuBlockCache.policy
Modifier and TypeMethodDescription(package private) Map<BlockCacheKey,
LruCachedBlock> LruAdaptiveBlockCache.getMapForTests()
(package private) Map<BlockCacheKey,
LruCachedBlock> LruBlockCache.getMapForTests()
Modifier and TypeMethodDescriptionvoid
BlockCache.cacheBlock
(BlockCacheKey cacheKey, Cacheable buf) Add block to cache (defaults to not in-memory).void
BlockCache.cacheBlock
(BlockCacheKey cacheKey, Cacheable buf, boolean inMemory) Add block to cache.default void
BlockCache.cacheBlock
(BlockCacheKey cacheKey, Cacheable buf, boolean inMemory, boolean waitWhenCache) Add block to cache.void
CombinedBlockCache.cacheBlock
(BlockCacheKey cacheKey, Cacheable buf) void
CombinedBlockCache.cacheBlock
(BlockCacheKey cacheKey, Cacheable buf, boolean inMemory) void
CombinedBlockCache.cacheBlock
(BlockCacheKey cacheKey, Cacheable buf, boolean inMemory, boolean waitWhenCache) void
InclusiveCombinedBlockCache.cacheBlock
(BlockCacheKey cacheKey, Cacheable buf, boolean inMemory) void
IndexOnlyLruBlockCache.cacheBlock
(BlockCacheKey cacheKey, Cacheable buf, boolean inMemory) Cache only index block with the specified name and buffervoid
LruAdaptiveBlockCache.cacheBlock
(BlockCacheKey cacheKey, Cacheable buf) Cache the block with the specified name and buffer.void
LruAdaptiveBlockCache.cacheBlock
(BlockCacheKey cacheKey, Cacheable buf, boolean inMemory) Cache the block with the specified name and buffer.void
LruBlockCache.cacheBlock
(BlockCacheKey cacheKey, Cacheable buf) Cache the block with the specified name and buffer.void
LruBlockCache.cacheBlock
(BlockCacheKey cacheKey, Cacheable buf, boolean inMemory) Cache the block with the specified name and buffer.void
MemcachedBlockCache.cacheBlock
(BlockCacheKey cacheKey, Cacheable buf) void
MemcachedBlockCache.cacheBlock
(BlockCacheKey cacheKey, Cacheable buf, boolean inMemory) void
TinyLfuBlockCache.cacheBlock
(BlockCacheKey key, Cacheable value) void
TinyLfuBlockCache.cacheBlock
(BlockCacheKey cacheKey, Cacheable value, boolean inMemory) boolean
FirstLevelBlockCache.containsBlock
(BlockCacheKey cacheKey) Whether the cache contains the block with specified cacheKeyboolean
LruAdaptiveBlockCache.containsBlock
(BlockCacheKey cacheKey) Whether the cache contains block with specified cacheKeyboolean
LruBlockCache.containsBlock
(BlockCacheKey cacheKey) Whether the cache contains block with specified cacheKeyboolean
TinyLfuBlockCache.containsBlock
(BlockCacheKey cacheKey) boolean
BlockCache.evictBlock
(BlockCacheKey cacheKey) Evict block from cache.boolean
CombinedBlockCache.evictBlock
(BlockCacheKey cacheKey) boolean
InclusiveCombinedBlockCache.evictBlock
(BlockCacheKey cacheKey) boolean
LruAdaptiveBlockCache.evictBlock
(BlockCacheKey cacheKey) boolean
LruBlockCache.evictBlock
(BlockCacheKey cacheKey) boolean
MemcachedBlockCache.evictBlock
(BlockCacheKey cacheKey) boolean
TinyLfuBlockCache.evictBlock
(BlockCacheKey cacheKey) BlockCache.getBlock
(BlockCacheKey cacheKey, boolean caching, boolean repeat, boolean updateCacheMetrics) Fetch block from cache.default Cacheable
BlockCache.getBlock
(BlockCacheKey cacheKey, boolean caching, boolean repeat, boolean updateCacheMetrics, BlockType blockType) Fetch block from cache.CombinedBlockCache.getBlock
(BlockCacheKey cacheKey, boolean caching, boolean repeat, boolean updateCacheMetrics) CombinedBlockCache.getBlock
(BlockCacheKey cacheKey, boolean caching, boolean repeat, boolean updateCacheMetrics, BlockType blockType) InclusiveCombinedBlockCache.getBlock
(BlockCacheKey cacheKey, boolean caching, boolean repeat, boolean updateCacheMetrics) LruAdaptiveBlockCache.getBlock
(BlockCacheKey cacheKey, boolean caching, boolean repeat, boolean updateCacheMetrics) Get the buffer of the block with the specified name.LruBlockCache.getBlock
(BlockCacheKey cacheKey, boolean caching, boolean repeat, boolean updateCacheMetrics) Get the buffer of the block with the specified name.MemcachedBlockCache.getBlock
(BlockCacheKey cacheKey, boolean caching, boolean repeat, boolean updateCacheMetrics) TinyLfuBlockCache.getBlock
(BlockCacheKey cacheKey, boolean caching, boolean repeat, boolean updateCacheMetrics) BlockCache.getBlockSize
(BlockCacheKey key) Returns an Optional containing the size of the block related to the passed key.CombinedBlockCache.getBlockSize
(BlockCacheKey key) private Cacheable
CombinedBlockCache.getBlockWithType
(BlockCacheKey cacheKey, boolean caching, boolean repeat, boolean updateCacheMetrics) private HFileBlock
HFileReaderImpl.getCachedBlock
(BlockCacheKey cacheKey, boolean cacheBlock, boolean useLock, boolean updateCacheMetrics, BlockType expectedBlockType, DataBlockEncoding expectedDataBlockEncoding) Retrieve block from cache.int
CombinedBlockCache.getRpcRefCount
(BlockCacheKey cacheKey) BlockCache.isAlreadyCached
(BlockCacheKey key) Checks whether the block for the passed key is already cached.CombinedBlockCache.isAlreadyCached
(BlockCacheKey key) 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.private void
CombinedBlockCache.updateBlockMetrics
(Cacheable block, BlockCacheKey key, BlockCache cache, boolean caching) 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.ModifierConstructorDescriptionCachedBlockView
(BlockCacheKey key, Cacheable value, long now) LruCachedBlock
(BlockCacheKey cacheKey, Cacheable buf, long accessTime) LruCachedBlock
(BlockCacheKey cacheKey, Cacheable buf, long accessTime, boolean inMemory) -
Uses of BlockCacheKey in org.apache.hadoop.hbase.io.hfile.bucket
Modifier and TypeFieldDescription(package private) Map<BlockCacheKey,
BucketEntry> BucketCache.backingMap
(package private) NavigableSet<BlockCacheKey>
BucketCache.blocksByHFile
private static final Comparator<Map.Entry<BlockCacheKey,
BucketEntry>> CachedEntryQueue.COMPARATOR
(package private) final ConcurrentHashMap<BlockCacheKey,
BucketCache.RAMQueueEntry> BucketCache.RAMCache.delegate
Defined the map asConcurrentHashMap
explicitly 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 TypeMethodDescription(package private) static Pair<ConcurrentHashMap<BlockCacheKey,
BucketEntry>, NavigableSet<BlockCacheKey>> BucketProtoUtils.fromPB
(Map<Integer, String> deserializers, org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMap backingMap, Function<BucketEntry, ByteBuffAllocator.Recycler> createRecycler) (package private) static Pair<ConcurrentHashMap<BlockCacheKey,
BucketEntry>, NavigableSet<BlockCacheKey>> BucketProtoUtils.fromPB
(Map<Integer, String> deserializers, org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMap backingMap, Function<BucketEntry, ByteBuffAllocator.Recycler> createRecycler) private Set<BlockCacheKey>
BucketCache.getAllCacheKeysForFile
(String hfileName, long init, long end) BucketCache.getBackingMap()
CachedEntryQueue.poll()
Returns The next element in this queue, ornull
if the queue is empty.CachedEntryQueue.pollLast()
Returns The last element in this queue, ornull
if the queue is empty.Modifier and TypeMethodDescription(package private) void
BucketCache.blockEvicted
(BlockCacheKey cacheKey, BucketEntry bucketEntry, boolean decrementBlockNumber, boolean evictedByEvictionProcess) This method is invoked after the bucketEntry is removed fromBucketCache.backingMap
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.cacheBlock
(BlockCacheKey cacheKey, Cacheable cachedItem, boolean inMemory, boolean waitWhenCache) Cache the block with the specified name and buffer.void
BucketCache.cacheBlockWithWait
(BlockCacheKey cacheKey, Cacheable cachedItem, boolean inMemory, boolean wait) Cache the block to ramCacheprotected void
BucketCache.cacheBlockWithWaitInternal
(BlockCacheKey cacheKey, Cacheable cachedItem, boolean inMemory, boolean wait) boolean
BucketCache.RAMCache.containsKey
(BlockCacheKey key) private boolean
BucketCache.doEvictBlock
(BlockCacheKey cacheKey, BucketEntry bucketEntry, boolean evictedByEvictionProcess) boolean
BucketCache.evictBlock
(BlockCacheKey cacheKey) Try to evict the block fromBlockCache
by force.boolean
BucketCache.evictBlockIfNoRpcReferenced
(BlockCacheKey blockCacheKey) NOTE: This method is only for test.(package private) boolean
BucketCache.evictBucketEntryIfNoRpcReferenced
(BlockCacheKey blockCacheKey, BucketEntry bucketEntry) BucketCache.RAMCache.get
(BlockCacheKey key) BucketCache.getBlock
(BlockCacheKey key, boolean caching, boolean repeat, boolean updateCacheMetrics) Get the buffer of the block with the specified key.BucketCache.getBlockForReference
(BlockCacheKey key) If the passed cache key relates to a reference (<hfile>.<parentEncRegion>), this method looks for the block from the referred file, in the cache.BucketCache.getBlockSize
(BlockCacheKey key) int
BucketCache.getRpcRefCount
(BlockCacheKey cacheKey) BucketCache.isAlreadyCached
(BlockCacheKey key) BucketCache.RAMCache.putIfAbsent
(BlockCacheKey key, BucketCache.RAMQueueEntry entry) Return the previous associated value, or null if absent.protected void
BucketCache.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 anConsumer
here, 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.protected boolean
BucketCache.removeFromRamCache
(BlockCacheKey cacheKey) protected boolean
BucketCache.shouldReplaceExistingCacheBlock
(BlockCacheKey cacheKey, Cacheable newBlock) private static org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BlockCacheKey
BucketProtoUtils.toPB
(BlockCacheKey key) Modifier and TypeMethodDescriptionvoid
BucketCache.BucketEntryGroup.add
(Map.Entry<BlockCacheKey, BucketEntry> block) void
CachedEntryQueue.add
(Map.Entry<BlockCacheKey, BucketEntry> entry) Attempt to add the specified entry to this queue.private static void
BucketProtoUtils.addEntryToBuilder
(Map.Entry<BlockCacheKey, BucketEntry> entry, org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMapEntry.Builder entryBuilder, org.apache.hadoop.hbase.shaded.protobuf.generated.BucketCacheProtos.BackingMap.Builder builder) ModifierConstructorDescription(package private)
RAMQueueEntry
(BlockCacheKey bck, Cacheable data, long accessCounter, boolean inMemory, boolean isCachePersistent) ModifierConstructorDescription(package private)
BucketAllocator
(long availableSpace, int[] bucketSizes, Map<BlockCacheKey, BucketEntry> map, LongAdder realCacheSize) Rebuild the allocator's data structures from a persisted map.