public abstract class AccumuloConfiguration extends Object implements Iterable<Map.Entry<String,String>>
Modifier and Type | Class and Description |
---|---|
static class |
AccumuloConfiguration.MatchFilter
A filter that accepts properties whose keys are an exact match.
|
static class |
AccumuloConfiguration.PrefixFilter
A filter that accepts properties whose keys begin with a prefix.
|
static interface |
AccumuloConfiguration.PropertyFilter
Deprecated.
since 1.7.0; use
Predicate instead. |
Constructor and Description |
---|
AccumuloConfiguration() |
Modifier and Type | Method and Description |
---|---|
abstract String |
get(Property property)
Gets a property value from this configuration.
|
String |
get(String property)
Gets a property value from this configuration.
|
Map<String,String> |
getAllPropertiesWithPrefix(Property property)
Gets all properties under the given prefix in this configuration.
|
boolean |
getBoolean(Property property)
Gets a property of type
PropertyType.BOOLEAN , interpreting the value properly (using Boolean.parseBoolean() ). |
int |
getCount(Property property)
Gets a property of type
PropertyType.COUNT , interpreting the value properly (as an integer). |
static DefaultConfiguration |
getDefaultConfiguration()
Gets the default configuration.
|
double |
getFraction(Property property)
Gets a property of type
PropertyType.FRACTION , interpreting the value properly. |
double |
getFraction(String str)
Interprets a string specifying a fraction.
|
int |
getMaxFilesPerTablet()
Gets the maximum number of files per tablet from this configuration.
|
long |
getMemoryInBytes(Property property)
Gets a property of type
PropertyType.MEMORY , interpreting the value properly. |
static long |
getMemoryInBytes(String str)
Interprets a string specifying a memory size.
|
String |
getPath(Property property)
Gets a property of type
PropertyType.PATH , interpreting the value properly, replacing supported environment variables. |
int |
getPort(Property property)
Gets a property of type
PropertyType.PORT , interpreting the value properly (as an integer within the range of non-privileged ports). |
abstract void |
getProperties(Map<String,String> props,
com.google.common.base.Predicate<String> filter)
Returns property key/value pairs in this configuration.
|
static AccumuloConfiguration |
getTableConfiguration(Connector conn,
String tableId)
Gets the configuration specific to a table.
|
long |
getTimeInMillis(Property property)
Gets a property of type
PropertyType.TIMEDURATION , interpreting the value properly. |
static long |
getTimeInMillis(String str)
Interprets a string specifying a time duration.
|
<T> T |
instantiateClassProperty(Property property,
Class<T> base,
T defaultInstance)
Creates a new instance of a class specified in a configuration property.
|
void |
invalidateCache()
Invalidates the
ZooCache used for storage and quick retrieval of properties for this configuration. |
Iterator<Map.Entry<String,String>> |
iterator()
Returns an iterator over property key/value pairs in this configuration.
|
public String get(String property)
Note: this is inefficient, but convenient on occasion. For retrieving multiple properties, use getProperties(Map, Predicate)
with a custom filter.
property
- property to getpublic abstract String get(Property property)
property
- property to getpublic abstract void getProperties(Map<String,String> props, com.google.common.base.Predicate<String> filter)
props
- properties object to populatefilter
- filter for accepting properties from this configurationpublic Iterator<Map.Entry<String,String>> iterator()
public Map<String,String> getAllPropertiesWithPrefix(Property property)
property
- prefix property, must be of type PropertyType.PREFIXIllegalArgumentException
- if property is not a prefixpublic long getMemoryInBytes(Property property)
PropertyType.MEMORY
, interpreting the value properly.property
- property to getIllegalArgumentException
- if the property is of the wrong typegetMemoryInBytes(String)
public static long getMemoryInBytes(String str)
str
- string valuepublic long getTimeInMillis(Property property)
PropertyType.TIMEDURATION
, interpreting the value properly.property
- property to getIllegalArgumentException
- if the property is of the wrong typegetTimeInMillis(String)
public static long getTimeInMillis(String str)
str
- string valuepublic boolean getBoolean(Property property)
PropertyType.BOOLEAN
, interpreting the value properly (using Boolean.parseBoolean()
).property
- property to getIllegalArgumentException
- if the property is of the wrong typepublic double getFraction(Property property)
PropertyType.FRACTION
, interpreting the value properly.property
- property to getIllegalArgumentException
- if the property is of the wrong typegetFraction(String)
public double getFraction(String str)
str
- string valuepublic int getPort(Property property)
PropertyType.PORT
, interpreting the value properly (as an integer within the range of non-privileged ports).property
- property to getIllegalArgumentException
- if the property is of the wrong typegetTimeInMillis(String)
public int getCount(Property property)
PropertyType.COUNT
, interpreting the value properly (as an integer).property
- property to getIllegalArgumentException
- if the property is of the wrong typegetTimeInMillis(String)
public String getPath(Property property)
PropertyType.PATH
, interpreting the value properly, replacing supported environment variables.property
- property to getIllegalArgumentException
- if the property is of the wrong typeConstants.PATH_PROPERTY_ENV_VARS
public static DefaultConfiguration getDefaultConfiguration()
DefaultConfiguration.getInstance()
public static AccumuloConfiguration getTableConfiguration(Connector conn, String tableId) throws TableNotFoundException, AccumuloException
conn
- connector (used to find table name)tableId
- table IDTableNotFoundException
- if the table is not foundAccumuloException
- if there is a problem communicating to Accumulopublic int getMaxFilesPerTablet()
Property.TABLE_FILE_MAX
,
Property.TSERV_SCAN_MAX_OPENFILES
public void invalidateCache()
ZooCache
used for storage and quick retrieval of properties for this configuration.public <T> T instantiateClassProperty(Property property, Class<T> base, T defaultInstance)
property
- property specifying class namebase
- base class of typedefaultInstance
- instance to use if creation failsAccumuloVFSClassLoader
Copyright © 2011–2016 The Apache Software Foundation. All rights reserved.