BucketCache.@InterfaceAudience.Private @Deprecated public class SingleSizeCache extends Object implements BlockCache, HeapSize
| Modifier and Type | Field and Description |
|---|---|
static long |
CACHE_FIXED_OVERHEAD
Deprecated.
|
| Constructor and Description |
|---|
SingleSizeCache(int blockSize,
int numBlocks,
org.apache.hadoop.hbase.io.hfile.slab.SlabItemActionWatcher master)
Deprecated.
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cacheBlock(BlockCacheKey blockName,
Cacheable toBeCached)
Deprecated.
Add block to cache (defaults to not in-memory).
|
void |
cacheBlock(BlockCacheKey cacheKey,
Cacheable buf,
boolean inMemory)
Deprecated.
Add block to cache.
|
boolean |
evictBlock(BlockCacheKey key)
Deprecated.
Evicts the block
|
int |
evictBlocksByHfileName(String hfileName)
Deprecated.
Evicts all blocks for the given HFile.
|
Cacheable |
getBlock(BlockCacheKey key,
boolean caching,
boolean repeat,
boolean updateCacheMetrics)
Deprecated.
Fetch block from cache.
|
BlockCache[] |
getBlockCaches()
Deprecated.
|
long |
getBlockCount()
Deprecated.
Returns the number of blocks currently cached in the block cache.
|
long |
getCurrentSize()
Deprecated.
Returns the occupied size of the block cache, in bytes.
|
long |
getEvictedCount()
Deprecated.
|
long |
getFreeSize()
Deprecated.
Returns the free size of the block cache, in bytes.
|
long |
getOccupiedSize()
Deprecated.
|
CacheStats |
getStats()
Deprecated.
Get the statistics for this block cache.
|
long |
heapSize()
Deprecated.
|
Iterator<CachedBlock> |
iterator()
Deprecated.
|
void |
logStats()
Deprecated.
|
void |
shutdown()
Deprecated.
Shutdown the cache.
|
long |
size()
Deprecated.
Returns the total size of the block cache, in bytes.
|
public SingleSizeCache(int blockSize,
int numBlocks,
org.apache.hadoop.hbase.io.hfile.slab.SlabItemActionWatcher master)
blockSize - the size of each block, in bytesnumBlocks - the number of blocks of blockSize this cache will hold.master - the SlabCache this SingleSlabCache is assigned to.public void cacheBlock(BlockCacheKey blockName, Cacheable toBeCached)
BlockCachecacheBlock in interface BlockCacheblockName - The block's cache key.toBeCached - The object to cache.public Cacheable getBlock(BlockCacheKey key, boolean caching, boolean repeat, boolean updateCacheMetrics)
BlockCachegetBlock in interface BlockCachekey - 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 notpublic boolean evictBlock(BlockCacheKey key)
evictBlock in interface BlockCachekey - the key of the entry we are going to evictpublic void logStats()
public void shutdown()
BlockCacheshutdown in interface BlockCachepublic long heapSize()
public long size()
BlockCachesize in interface BlockCachepublic long getFreeSize()
BlockCachegetFreeSize in interface BlockCachepublic long getOccupiedSize()
public long getEvictedCount()
public CacheStats getStats()
BlockCachegetStats in interface BlockCachepublic long getBlockCount()
BlockCachegetBlockCount in interface BlockCachepublic void cacheBlock(BlockCacheKey cacheKey, Cacheable buf, boolean inMemory)
BlockCachecacheBlock in interface BlockCachecacheKey - The block's cache key.buf - The block contents wrapped in a ByteBuffer.inMemory - Whether block should be treated as in-memorypublic int evictBlocksByHfileName(String hfileName)
BlockCacheevictBlocksByHfileName in interface BlockCachepublic long getCurrentSize()
BlockCachegetCurrentSize in interface BlockCachepublic Iterator<CachedBlock> iterator()
iterator in interface Iterable<CachedBlock>iterator in interface BlockCachepublic BlockCache[] getBlockCaches()
getBlockCaches in interface BlockCacheCopyright © 2014 The Apache Software Foundation. All rights reserved.