Package org.apache.accumulo.server.conf
Class ZooBasedConfiguration
- java.lang.Object
-
- org.apache.accumulo.core.conf.AccumuloConfiguration
-
- org.apache.accumulo.server.conf.ZooBasedConfiguration
-
- Direct Known Subclasses:
NamespaceConfiguration
,SystemConfiguration
,TableConfiguration
public class ZooBasedConfiguration extends AccumuloConfiguration
Instances maintain a local cache of the AccumuloConfiguration hierarchy that will be consistent with stored properties.When calling getProperties - the local copy will be updated if ZooKeeper changes have been received.
The getUpdateCount() provides an optimization for clients - the count can be used to detect changes without reading the properties. When the update count changes, the next getProperties call will update the local copy and the change count.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.accumulo.core.conf.AccumuloConfiguration
AccumuloConfiguration.Deriver<T extends Object>, AccumuloConfiguration.ScanExecutorConfig
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Logger
log
-
Constructor Summary
Constructors Constructor Description ZooBasedConfiguration(org.slf4j.Logger log, ServerContext context, PropStoreKey<?> propStoreKey, AccumuloConfiguration parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable String
get(Property property)
long
getDataVersion()
AccumuloConfiguration
getParent()
void
getProperties(Map<String,String> props, Predicate<String> filter)
PropStoreKey<?>
getPropStoreKey()
@NonNull Map<String,String>
getSnapshot()
long
getUpdateCount()
The update count is the sum of the change count of this configuration and the change counts of the parents.void
invalidateCache()
boolean
isPropertySet(Property property)
void
zkChangeEvent(PropStoreKey<?> propStoreKey)
-
Methods inherited from class org.apache.accumulo.core.conf.AccumuloConfiguration
get, getAllCryptoProperties, getAllPropertiesWithPrefix, getAllPropertiesWithPrefixStripped, getAsBytes, getBoolean, getCount, getFraction, getMaxFilesPerTablet, getPath, getPort, getPortStream, getScanExecutors, getTimeInMillis, iterator, newDeriver, resolve, stream
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
ZooBasedConfiguration
public ZooBasedConfiguration(org.slf4j.Logger log, ServerContext context, PropStoreKey<?> propStoreKey, AccumuloConfiguration parent)
-
-
Method Detail
-
zkChangeEvent
public void zkChangeEvent(PropStoreKey<?> propStoreKey)
-
getDataVersion
public long getDataVersion()
-
getUpdateCount
public long getUpdateCount()
The update count is the sum of the change count of this configuration and the change counts of the parents. The count is used to detect if any changes occurred in the configuration hierarchy and if the configuration needs to be recalculated to maintain consistency with values in the backend store.The count is required to be an increasing value.
- Overrides:
getUpdateCount
in classAccumuloConfiguration
-
getParent
public AccumuloConfiguration getParent()
- Overrides:
getParent
in classAccumuloConfiguration
-
getPropStoreKey
public PropStoreKey<?> getPropStoreKey()
-
get
public @Nullable String get(Property property)
- Specified by:
get
in classAccumuloConfiguration
-
getProperties
public void getProperties(Map<String,String> props, Predicate<String> filter)
- Specified by:
getProperties
in classAccumuloConfiguration
-
isPropertySet
public boolean isPropertySet(Property property)
- Specified by:
isPropertySet
in classAccumuloConfiguration
-
invalidateCache
public void invalidateCache()
- Overrides:
invalidateCache
in classAccumuloConfiguration
-
-