org.apache.accumulo.core.file.blockfile.cache
Class SimpleBlockCache

java.lang.Object
  extended by org.apache.accumulo.core.file.blockfile.cache.SimpleBlockCache
All Implemented Interfaces:
BlockCache

public class SimpleBlockCache
extends Object
implements BlockCache

Simple one RFile soft reference cache.


Field Summary
 int dumps
           
 
Constructor Summary
SimpleBlockCache()
          Constructor
 
Method Summary
 org.apache.accumulo.core.file.blockfile.cache.SimpleBlockCache.SimpleCacheEntry cacheBlock(String blockName, byte[] buf)
          Add block to cache (defaults to not in-memory).
 org.apache.accumulo.core.file.blockfile.cache.SimpleBlockCache.SimpleCacheEntry cacheBlock(String blockName, byte[] buf, boolean inMemory)
          Add block to cache.
 org.apache.accumulo.core.file.blockfile.cache.SimpleBlockCache.SimpleCacheEntry getBlock(String blockName)
          Fetch block from cache.
 long getMaxSize()
          Get the maximum size of this cache.
 void shutdown()
          Shutdown the cache.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dumps

public int dumps
Constructor Detail

SimpleBlockCache

public SimpleBlockCache()
Constructor

Method Detail

size

public int size()
Returns:
the size

getBlock

public org.apache.accumulo.core.file.blockfile.cache.SimpleBlockCache.SimpleCacheEntry getBlock(String blockName)
Description copied from interface: BlockCache
Fetch block from cache.

Specified by:
getBlock in interface BlockCache
Parameters:
blockName - Block number to fetch.
Returns:
Block or null if block is not in the cache.

cacheBlock

public org.apache.accumulo.core.file.blockfile.cache.SimpleBlockCache.SimpleCacheEntry cacheBlock(String blockName,
                                                                                                  byte[] buf)
Description copied from interface: BlockCache
Add block to cache (defaults to not in-memory).

Specified by:
cacheBlock in interface BlockCache
Parameters:
blockName - Zero-based file block number.
buf - The block contents wrapped in a ByteBuffer.

cacheBlock

public org.apache.accumulo.core.file.blockfile.cache.SimpleBlockCache.SimpleCacheEntry cacheBlock(String blockName,
                                                                                                  byte[] buf,
                                                                                                  boolean inMemory)
Description copied from interface: BlockCache
Add block to cache.

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

shutdown

public void shutdown()
Description copied from interface: BlockCache
Shutdown the cache.

Specified by:
shutdown in interface BlockCache

getMaxSize

public long getMaxSize()
Description copied from interface: BlockCache
Get the maximum size of this cache.

Specified by:
getMaxSize in interface BlockCache
Returns:
max size in bytes


Copyright © 2015 Apache Accumulo Project. All rights reserved.