|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface BlockCache
Block cache interface. Anything that implements the Cacheable
interface can be put in the cache.
TODO: Add filename or hash of filename to block cache key.
| Method Summary | |
|---|---|
void |
cacheBlock(String blockName,
Cacheable buf)
Add block to cache (defaults to not in-memory). |
void |
cacheBlock(String blockName,
Cacheable buf,
boolean inMemory)
Add block to cache. |
boolean |
evictBlock(String blockName)
Evict block from cache. |
int |
evictBlocksByPrefix(String string)
Evicts all blocks with name starting with the given prefix. |
Cacheable |
getBlock(String blockName,
boolean caching)
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. |
void |
shutdown()
Shutdown the cache. |
long |
size()
Returns the total size of the block cache, in bytes. |
| Method Detail |
|---|
void cacheBlock(String blockName,
Cacheable buf,
boolean inMemory)
blockName - Zero-based file block number.buf - The block contents wrapped in a ByteBuffer.inMemory - Whether block should be treated as in-memory
void cacheBlock(String blockName,
Cacheable buf)
blockName - Zero-based file block number.buf - The object to cache.
Cacheable getBlock(String blockName,
boolean caching)
blockName - Block number to fetch.caching - Whether this request has caching enabled (used for stats)
boolean evictBlock(String blockName)
blockName - Block name to evict
int evictBlocksByPrefix(String string)
CacheStats getStats()
void shutdown()
long size()
long getFreeSize()
long getCurrentSize()
long getEvictedCount()
long getBlockCount()
List<BlockCacheColumnFamilySummary> getBlockCacheColumnFamilySummaries(org.apache.hadoop.conf.Configuration conf)
throws IOException
conf - HBaseConfiguration
IOException - exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||