Package | Description |
---|---|
org.apache.hadoop.hbase.io.hfile |
Provides implementations of
HFile and HFile
BlockCache . |
org.apache.hadoop.hbase.io.hfile.bucket |
Provides
BucketCache , an implementation of
BlockCache . |
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.map
Defined the cache map as
ConcurrentHashMap here, because in
LruBlockCache.getBlock(org.apache.hadoop.hbase.io.hfile.BlockCacheKey, boolean, boolean, boolean) , we need to guarantee the atomicity of map#computeIfPresent
(key, func). |
private ConcurrentHashMap<BlockCacheKey,LruCachedBlock> |
LruAdaptiveBlockCache.map
Defined the cache map as
ConcurrentHashMap here, because in
LruAdaptiveBlockCache.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() |
(package private) Map<BlockCacheKey,LruCachedBlock> |
LruAdaptiveBlockCache.getMapForTests() |
Modifier and Type | Method and Description |
---|---|
void |
LruBlockCache.cacheBlock(BlockCacheKey cacheKey,
Cacheable buf)
Cache the block with the specified name and buffer.
|
void |
LruAdaptiveBlockCache.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 |
LruAdaptiveBlockCache.cacheBlock(BlockCacheKey cacheKey,
Cacheable buf,
boolean inMemory)
Cache the block with the specified name and buffer.
|
void |
IndexOnlyLruBlockCache.cacheBlock(BlockCacheKey cacheKey,
Cacheable buf,
boolean inMemory)
Cache only index 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 |
LruAdaptiveBlockCache.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 |
LruAdaptiveBlockCache.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 |
LruAdaptiveBlockCache.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.delegate
Defined the map as
ConcurrentHashMap explicitly here, because in
BucketCache.RAMCache.get(BlockCacheKey) and
BucketCache.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,
Function<BucketEntry,ByteBuffAllocator.Recycler> createRecycler) |
Map.Entry<BlockCacheKey,BucketEntry> |
CachedEntryQueue.poll()
Returns The next element in this queue, or
null if the queue is empty. |
Map.Entry<BlockCacheKey,BucketEntry> |
CachedEntryQueue.pollLast()
Returns The last element in this queue, or
null if the queue is empty. |
Modifier and Type | Method and Description |
---|---|
(package private) void |
BucketCache.blockEvicted(BlockCacheKey cacheKey,
BucketEntry bucketEntry,
boolean decrementBlockNumber,
boolean evictedByEvictionProcess)
This method is invoked after the bucketEntry is removed from
BucketCache.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.cacheBlockWithWait(BlockCacheKey cacheKey,
Cacheable cachedItem,
boolean inMemory,
boolean wait)
Cache the block to ramCache
|
protected 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 from
BlockCache by force. |
boolean |
BucketCache.evictBlockIfNoRpcReferenced(BlockCacheKey blockCacheKey)
NOTE: This method is only for test.
|
(package private) boolean |
BucketCache.evictBucketEntryIfNoRpcReferenced(BlockCacheKey blockCacheKey,
BucketEntry bucketEntry)
|
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.
|
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 an
Consumer 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 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) |
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–2020 The Apache Software Foundation. All rights reserved.