|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.io.hfile.CombinedBlockCache
@InterfaceAudience.Private public class CombinedBlockCache
CombinedBlockCache is an abstraction layer that combines
LruBlockCache and BucketCache. The smaller lruCache is used
to cache bloom blocks and index blocks , the larger bucketCache is used to
cache data blocks. getBlock reads first from the smaller lruCache before
looking for the block in the bucketCache. Metrics are the combined size and
hits and misses of both caches.
| Constructor Summary | |
|---|---|
CombinedBlockCache(LruBlockCache lruCache,
BucketCache bucketCache)
|
|
| Method Summary | |
|---|---|
void |
cacheBlock(BlockCacheKey cacheKey,
Cacheable buf)
Add block to cache (defaults to not in-memory). |
void |
cacheBlock(BlockCacheKey cacheKey,
Cacheable buf,
boolean inMemory)
Add block to cache. |
boolean |
evictBlock(BlockCacheKey cacheKey)
Evict block from cache. |
int |
evictBlocksByHfileName(String hfileName)
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 evictions that have occurred. |
long |
getFreeSize()
Returns the free size of the block cache, in bytes. |
CacheStats |
getStats()
Get the statistics for this block cache. |
long |
heapSize()
|
void |
shutdown()
Shutdown the cache. |
long |
size()
Returns the total size of the block cache, in bytes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CombinedBlockCache(LruBlockCache lruCache,
BucketCache bucketCache)
| Method Detail |
|---|
public long heapSize()
heapSize in interface HeapSize
public void cacheBlock(BlockCacheKey cacheKey,
Cacheable buf,
boolean inMemory)
BlockCache
cacheBlock in interface BlockCachecacheKey - The block's cache key.buf - The block contents wrapped in a ByteBuffer.inMemory - Whether block should be treated as in-memory
public void cacheBlock(BlockCacheKey cacheKey,
Cacheable buf)
BlockCache
cacheBlock in interface BlockCachecacheKey - The block's cache key.buf - The object to cache.
public Cacheable getBlock(BlockCacheKey cacheKey,
boolean caching,
boolean repeat)
BlockCache
getBlock 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 boolean evictBlock(BlockCacheKey cacheKey)
BlockCache
evictBlock in interface BlockCachecacheKey - Block to evict
public int evictBlocksByHfileName(String hfileName)
BlockCache
evictBlocksByHfileName in interface BlockCachepublic CacheStats getStats()
BlockCache
getStats in interface BlockCachepublic void shutdown()
BlockCache
shutdown in interface BlockCachepublic long size()
BlockCache
size in interface BlockCachepublic long getFreeSize()
BlockCache
getFreeSize in interface BlockCachepublic long getCurrentSize()
BlockCache
getCurrentSize in interface BlockCachepublic long getEvictedCount()
BlockCache
getEvictedCount in interface BlockCachepublic long getBlockCount()
BlockCache
getBlockCount in interface BlockCache
public List<BlockCacheColumnFamilySummary> getBlockCacheColumnFamilySummaries(org.apache.hadoop.conf.Configuration conf)
throws IOException
BlockCache
getBlockCacheColumnFamilySummaries in interface BlockCacheconf - HBaseConfiguration
IOException - exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||