org.apache.accumulo.core.file.blockfile.cache
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, byte[] buf)
          Add block to cache (defaults to not in-memory).
 void cacheBlock(String blockName, byte[] buf, boolean inMemory)
          Add block to cache.
 byte[] getBlock(String blockName)
          Fetch block from cache.
 void shutdown()
          Shutdown the cache.
 

Method Detail

cacheBlock

void cacheBlock(String blockName,
                byte[] 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,
                byte[] 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

byte[] getBlock(String blockName)
Fetch block from cache.

Parameters:
blockName - Block number to fetch.
Returns:
Block or null if block is not in the cache.

shutdown

void shutdown()
Shutdown the cache.



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