Class BlockCacheManager
- java.lang.Object
-
- org.apache.accumulo.core.spi.cache.BlockCacheManager
-
- Direct Known Subclasses:
LruBlockCacheManager,TinyLfuBlockCacheManager
public abstract class BlockCacheManager extends Object
- Since:
- 2.0.0
- See Also:
org.apache.accumulo.core.spi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceBlockCacheManager.Configuration
-
Field Summary
Fields Modifier and Type Field Description static StringCACHE_PROPERTY_BASE
-
Constructor Summary
Constructors Constructor Description BlockCacheManager()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract BlockCachecreateCache(BlockCacheManager.Configuration conf, CacheType type)Create a block cache using the supplied configurationBlockCachegetBlockCache(CacheType type)Get the block cache of the given typestatic StringgetFullyQualifiedPropertyPrefix(String prefix)A convenience method that returns a string of the fromtserver.cache.config.<prefix>.default.this method is useful for configuring a cache manager.static StringgetFullyQualifiedPropertyPrefix(String prefix, CacheType type)A convenience method that returns a string of the fromtserver.cache.config.<prefix>.<type>.this method is useful for configuring a cache manager.voidstart(BlockCacheManager.Configuration conf)Initialize the caches for each CacheType based on the configurationvoidstop()Stop caches and release resources
-
-
-
Field Detail
-
CACHE_PROPERTY_BASE
public static final String CACHE_PROPERTY_BASE
-
-
Method Detail
-
start
public void start(BlockCacheManager.Configuration conf)
Initialize the caches for each CacheType based on the configuration- Parameters:
conf- accumulo configuration
-
stop
public void stop()
Stop caches and release resources
-
getBlockCache
public BlockCache getBlockCache(CacheType type)
Get the block cache of the given type- Parameters:
type- block cache type- Returns:
- BlockCache or null if not enabled
-
createCache
protected abstract BlockCache createCache(BlockCacheManager.Configuration conf, CacheType type)
Create a block cache using the supplied configuration- Parameters:
conf- cache configuration- Returns:
- configured block cache
-
getFullyQualifiedPropertyPrefix
public static String getFullyQualifiedPropertyPrefix(String prefix)
A convenience method that returns a string of the fromtserver.cache.config.<prefix>.default.this method is useful for configuring a cache manager.- Parameters:
prefix- A unique identifier that corresponds to a particular BlockCacheManager implementation.- See Also:
BlockCacheManager.Configuration.getProperties(String, CacheType)
-
getFullyQualifiedPropertyPrefix
public static String getFullyQualifiedPropertyPrefix(String prefix, CacheType type)
A convenience method that returns a string of the fromtserver.cache.config.<prefix>.<type>.this method is useful for configuring a cache manager.- Parameters:
prefix- A unique identifier that corresponds to a particular BlockCacheManager implementation.- See Also:
BlockCacheManager.Configuration.getProperties(String, CacheType)
-
-