Package org.apache.hadoop.hbase.io.hfile
Class InclusiveCombinedBlockCache
java.lang.Object
org.apache.hadoop.hbase.io.hfile.CombinedBlockCache
org.apache.hadoop.hbase.io.hfile.InclusiveCombinedBlockCache
- All Implemented Interfaces:
Iterable<CachedBlock>
,HeapSize
,BlockCache
,ResizableBlockCache
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.io.hfile.CombinedBlockCache
CombinedBlockCache.CombinedCacheStats
-
Field Summary
Fields inherited from class org.apache.hadoop.hbase.io.hfile.CombinedBlockCache
combinedCacheStats, l1Cache, l2Cache
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cacheBlock
(BlockCacheKey cacheKey, Cacheable buf, boolean inMemory) Add block to cache.boolean
evictBlock
(BlockCacheKey cacheKey) Evict block from cache.getBlock
(BlockCacheKey cacheKey, boolean caching, boolean repeat, boolean updateCacheMetrics) Fetch block from cache.Methods inherited from class org.apache.hadoop.hbase.io.hfile.CombinedBlockCache
blockFitsIntoTheCache, cacheBlock, cacheBlock, evictBlocksByHfileName, getBlockCaches, getBlockCount, getBlockSize, getCurrentDataSize, getCurrentSize, getDataBlockCount, getFirstLevelCache, getFreeSize, getFullyCachedFiles, getMaxSize, getRpcRefCount, getSecondLevelCache, getStats, heapSize, isAlreadyCached, iterator, notifyFileBlockEvicted, notifyFileCachingCompleted, setMaxSize, shouldCacheFile, shutdown, size
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.io.hfile.BlockCache
isMetaBlock
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
InclusiveCombinedBlockCache
-
-
Method Details
-
getBlock
public Cacheable getBlock(BlockCacheKey cacheKey, boolean caching, boolean repeat, boolean updateCacheMetrics) Description copied from interface:BlockCache
Fetch block from cache.- Specified by:
getBlock
in interfaceBlockCache
- Overrides:
getBlock
in classCombinedBlockCache
- Parameters:
cacheKey
- Block to fetch.caching
- Whether this request has caching enabled (used for stats)repeat
- Whether this is a repeat lookup for the same block (used to avoid double counting cache misses when doing double-check locking)updateCacheMetrics
- Whether to update cache metrics or not- Returns:
- Block or null if block is not in 2 cache.
-
cacheBlock
Description copied from interface:BlockCache
Add block to cache.- Specified by:
cacheBlock
in interfaceBlockCache
- Overrides:
cacheBlock
in classCombinedBlockCache
- Parameters:
cacheKey
- The block's cache key.buf
- The block contents wrapped in a ByteBuffer.inMemory
- Whether block should be treated as in-memory. This parameter is only useful for the L1 lru cache.
-
evictBlock
Description copied from interface:BlockCache
Evict block from cache.- Specified by:
evictBlock
in interfaceBlockCache
- Overrides:
evictBlock
in classCombinedBlockCache
- Parameters:
cacheKey
- Block to evict- Returns:
- true if block existed and was evicted, false if not
-