org.apache.accumulo.core.file.blockfile.cache
Interface BlockCache

All Known Implementing Classes:
LruBlockCache, SimpleBlockCache

public interface BlockCache

Block cache interface.


Method Summary
 CacheEntry cacheBlock(String blockName, byte[] buf)
          Add block to cache (defaults to not in-memory).
 CacheEntry cacheBlock(String blockName, byte[] buf, boolean inMemory)
          Add block to cache.
 CacheEntry getBlock(String blockName)
          Fetch block from cache.
 long getMaxSize()
          Get the maximum size of this cache.
 void shutdown()
          Shutdown the cache.
 

Method Detail

cacheBlock

CacheEntry 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

CacheEntry 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

CacheEntry 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.


getMaxSize

long getMaxSize()
Get the maximum size of this cache.

Returns:
max size in bytes


Copyright © 2015 Apache Accumulo Project. All rights reserved.