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.Loggerlog
-
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 Stringget(Property property)longgetDataVersion()AccumuloConfigurationgetParent()voidgetProperties(Map<String,String> props, Predicate<String> filter)PropStoreKey<?>getPropStoreKey()@NonNull Map<String,String>getSnapshot()longgetUpdateCount()The update count is the sum of the change count of this configuration and the change counts of the parents.voidinvalidateCache()booleanisPropertySet(Property property)voidzkChangeEvent(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:
getUpdateCountin classAccumuloConfiguration
-
getParent
public AccumuloConfiguration getParent()
- Overrides:
getParentin classAccumuloConfiguration
-
getPropStoreKey
public PropStoreKey<?> getPropStoreKey()
-
get
public @Nullable String get(Property property)
- Specified by:
getin classAccumuloConfiguration
-
getProperties
public void getProperties(Map<String,String> props, Predicate<String> filter)
- Specified by:
getPropertiesin classAccumuloConfiguration
-
isPropertySet
public boolean isPropertySet(Property property)
- Specified by:
isPropertySetin classAccumuloConfiguration
-
invalidateCache
public void invalidateCache()
- Overrides:
invalidateCachein classAccumuloConfiguration
-
-