@InterfaceAudience.Private public class SimpleBlockCache extends Object implements BlockCache
| Modifier and Type | Field and Description |
|---|---|
int |
dumps |
| Constructor and Description |
|---|
SimpleBlockCache()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
cacheBlock(BlockCacheKey cacheKey,
Cacheable block)
Add block to cache (defaults to not in-memory).
|
void |
cacheBlock(BlockCacheKey cacheKey,
Cacheable block,
boolean inMemory)
Add block to cache.
|
boolean |
evictBlock(BlockCacheKey cacheKey)
Evict block from cache.
|
int |
evictBlocksByHfileName(String string)
Evicts all blocks for the given HFile.
|
Cacheable |
getBlock(BlockCacheKey cacheKey,
boolean caching,
boolean repeat)
Fetch block from cache.
|
List<BlockCacheColumnFamilySummary> |
getBlockCacheColumnFamilySummaries(org.apache.hadoop.conf.Configuration conf)
Performs a BlockCache summary and returns a List of BlockCacheColumnFamilySummary objects.
|
long |
getBlockCount()
Returns the number of blocks currently cached in the block cache.
|
long |
getCurrentSize()
Returns the occupied size of the block cache, in bytes.
|
long |
getEvictedCount()
Returns the number of blocks that have been evicted.
|
long |
getFreeSize()
Returns the free size of the block cache, in bytes.
|
CacheStats |
getStats()
Get the statistics for this block cache.
|
void |
shutdown()
Shutdown the cache.
|
long |
size()
Returns the total size of the block cache, in bytes.
|
public long size()
BlockCachesize in interface BlockCachepublic Cacheable getBlock(BlockCacheKey cacheKey, boolean caching, boolean repeat)
BlockCachegetBlock in interface BlockCachecacheKey - 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)HFileReaderV2.readBlock(long, long, boolean, boolean, boolean, BlockType)public void cacheBlock(BlockCacheKey cacheKey, Cacheable block)
BlockCachecacheBlock in interface BlockCachecacheKey - The block's cache key.block - The object to cache.public void cacheBlock(BlockCacheKey cacheKey, Cacheable block, boolean inMemory)
BlockCachecacheBlock in interface BlockCachecacheKey - The block's cache key.block - The block contents wrapped in a ByteBuffer.inMemory - Whether block should be treated as in-memorypublic boolean evictBlock(BlockCacheKey cacheKey)
BlockCacheevictBlock in interface BlockCachecacheKey - Block to evictpublic void shutdown()
BlockCacheshutdown in interface BlockCachepublic CacheStats getStats()
BlockCachegetStats in interface BlockCachepublic long getFreeSize()
BlockCachegetFreeSize in interface BlockCachepublic long getCurrentSize()
BlockCachegetCurrentSize in interface BlockCachepublic long getEvictedCount()
BlockCachegetEvictedCount in interface BlockCachepublic int evictBlocksByHfileName(String string)
BlockCacheevictBlocksByHfileName in interface BlockCachepublic List<BlockCacheColumnFamilySummary> getBlockCacheColumnFamilySummaries(org.apache.hadoop.conf.Configuration conf)
BlockCachegetBlockCacheColumnFamilySummaries in interface BlockCacheconf - HBaseConfigurationpublic long getBlockCount()
BlockCachegetBlockCount in interface BlockCacheCopyright © 2014 The Apache Software Foundation. All Rights Reserved.