org.apache.hadoop.hbase.io.hfile
Interface BlockCache

All Known Implementing Classes:
LruBlockCache, SimpleBlockCache

public interface BlockCache

Block cache interface. TODO: Add filename or hash of filename to block cache key.


Method Summary
 void cacheBlock(String blockName, ByteBuffer buf)
          Add block to cache (defaults to not in-memory).
 void cacheBlock(String blockName, ByteBuffer buf, boolean inMemory)
          Add block to cache.
 ByteBuffer getBlock(String blockName, boolean caching)
          Fetch block from cache.
 void shutdown()
          Shutdown the cache.
 

Method Detail

cacheBlock

void cacheBlock(String blockName,
                ByteBuffer buf,
                boolean inMemory)
Add block to cache.

Parameters:
blockName - Zero-based file block number.
buf - The block contents wrapped in a ByteBuffer.
inMemory - Whether block should be treated as in-memory

cacheBlock

void cacheBlock(String blockName,
                ByteBuffer buf)
Add block to cache (defaults to not in-memory).

Parameters:
blockName - Zero-based file block number.
buf - The block contents wrapped in a ByteBuffer.

getBlock

ByteBuffer getBlock(String blockName,
                    boolean caching)
Fetch block from cache.

Parameters:
blockName - Block number to fetch.
caching - Whether this request has caching enabled (used for stats)
Returns:
Block or null if block is not in the cache.

shutdown

void shutdown()
Shutdown the cache.



Copyright © 2011 The Apache Software Foundation. All Rights Reserved.