org.apache.accumulo.core.file.blockfile.cache
public class SimpleBlockCache extends Object implements BlockCache
Modifier and Type | Field and Description |
---|---|
int |
dumps |
Constructor and Description |
---|
SimpleBlockCache()
Constructor
|
Modifier and Type | Method and Description |
---|---|
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() |
public int size()
public org.apache.accumulo.core.file.blockfile.cache.SimpleBlockCache.SimpleCacheEntry getBlock(String blockName)
BlockCache
getBlock
in interface BlockCache
blockName
- Block number to fetch.public org.apache.accumulo.core.file.blockfile.cache.SimpleBlockCache.SimpleCacheEntry cacheBlock(String blockName, byte[] buf)
BlockCache
cacheBlock
in interface BlockCache
blockName
- Zero-based file block number.buf
- The block contents wrapped in a ByteBuffer.public org.apache.accumulo.core.file.blockfile.cache.SimpleBlockCache.SimpleCacheEntry cacheBlock(String blockName, byte[] buf, boolean inMemory)
BlockCache
cacheBlock
in interface BlockCache
blockName
- Zero-based file block number.buf
- The block contents wrapped in a ByteBuffer.inMemory
- Whether block should be treated as in-memorypublic void shutdown()
BlockCache
shutdown
in interface BlockCache
public long getMaxSize()
BlockCache
getMaxSize
in interface BlockCache
Copyright © 2011–2016 The Apache Software Foundation. All rights reserved.