Class BlockCacheConfiguration
- java.lang.Object
-
- org.apache.accumulo.core.file.blockfile.cache.impl.BlockCacheConfiguration
-
- All Implemented Interfaces:
BlockCacheManager.Configuration
public class BlockCacheConfiguration extends Object implements BlockCacheManager.Configuration
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BlockCacheConfiguration
forScanServer(AccumuloConfiguration conf)
static BlockCacheConfiguration
forTabletServer(AccumuloConfiguration conf)
long
getBlockSize()
Before Accumulo's cache implementation was configurable, its built in cache had a configurable block size.static String
getCachePropertyBase(Property serverPrefix)
static String
getFullyQualifiedPropertyPrefix(Property serverPrefix, String prefix)
static String
getFullyQualifiedPropertyPrefix(Property serverPrefix, String prefix, CacheType type)
long
getMaxSize(CacheType type)
Before Accumulo's cache implementation was configurable, its built in caches had a configurable size.Map<String,String>
getProperties(String prefix, CacheType type)
This method provides a way for a cache implementation to access arbitrary configuration set by a user.String
toString()
-
-
-
Method Detail
-
forTabletServer
public static BlockCacheConfiguration forTabletServer(AccumuloConfiguration conf)
-
forScanServer
public static BlockCacheConfiguration forScanServer(AccumuloConfiguration conf)
-
getMaxSize
public long getMaxSize(CacheType type)
Description copied from interface:BlockCacheManager.Configuration
Before Accumulo's cache implementation was configurable, its built in caches had a configurable size. These sizes were specified by the system propertiestserver.cache.config.data.size
,tserver.cache.config.index.size
, andtserver.cache.config.summary.size
. This method returns the values of those settings. The settings are made available, but cache implementations are under no obligation to use them.When this plugin is running in a scan server, the value associated with
sserver.cache.config.data.size
,sserver.cache.config.index.size
, andsserver.cache.config.summary.size
are returned instead of tserver values.- Specified by:
getMaxSize
in interfaceBlockCacheManager.Configuration
-
getBlockSize
public long getBlockSize()
Description copied from interface:BlockCacheManager.Configuration
Before Accumulo's cache implementation was configurable, its built in cache had a configurable block size. This block size was specified by the system propertytserver.default.blocksize
. This method returns the value of that setting. The setting is made available, but cache implementations are under no obligation to use it.When this plugin is running in scan server, the value associated with
sserver.default.blocksize
is returned instead.- Specified by:
getBlockSize
in interfaceBlockCacheManager.Configuration
-
getProperties
public Map<String,String> getProperties(String prefix, CacheType type)
Description copied from interface:BlockCacheManager.Configuration
This method provides a way for a cache implementation to access arbitrary configuration set by a user.When running in a tserver, returns all Accumulo properties that have a prefix of
tserver.cache.config.<prefix>.<type>.
ortserver.cache.config.<prefix>.default.
with values for specific cache types overriding defaults.When running in a scan server, returns all Accumulo properties that have a prefix of
sserver.cache.config.<prefix>.<type>.
orsserver.cache.config.<prefix>.default.
with values for specific cache types overriding defaults.For example assume the following data is in Accumulo's system config and the plugin is running in a tserver.
tserver.cache.config.lru.default.evictAfter=3600 tserver.cache.config.lru.default.loadFactor=.75 tserver.cache.config.lru.index.loadFactor=.55 tserver.cache.config.lru.data.loadFactor=.65
If this method is called with
prefix=lru
andtype=INDEX
then it would return a map with the following key values. The load factor setting for index overrides the default value.evictAfter=3600 loadFactor=.55
- Specified by:
getProperties
in interfaceBlockCacheManager.Configuration
- Parameters:
prefix
- A unique identifier that corresponds to a particular BlockCacheManager implementation.
-
getFullyQualifiedPropertyPrefix
public static String getFullyQualifiedPropertyPrefix(Property serverPrefix, String prefix)
-
getFullyQualifiedPropertyPrefix
public static String getFullyQualifiedPropertyPrefix(Property serverPrefix, String prefix, CacheType type)
-
-