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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcacheBlock(BlockCacheKey cacheKey, Cacheable buf, boolean inMemory) Add block to cache.booleanevictBlock(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, sizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.io.hfile.BlockCache
isMetaBlockMethods 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:BlockCacheFetch block from cache.- Specified by:
getBlockin interfaceBlockCache- Overrides:
getBlockin 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:BlockCacheAdd block to cache.- Specified by:
cacheBlockin interfaceBlockCache- Overrides:
cacheBlockin 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:BlockCacheEvict block from cache.- Specified by:
evictBlockin interfaceBlockCache- Overrides:
evictBlockin classCombinedBlockCache- Parameters:
cacheKey- Block to evict- Returns:
- true if block existed and was evicted, false if not
-