Class PropSnapshot
- java.lang.Object
-
- org.apache.accumulo.server.conf.util.PropSnapshot
-
- All Implemented Interfaces:
PropChangeListener
public class PropSnapshot extends Object implements PropChangeListener
This class provides a secondary, local cache of properties and is intended to be used to optimize constructing a configuration hierarchy from the underlying properties stored in ZooKeeper.Configurations and especially the derivers use an updateCount to detect configuration changes. The updateCount is checked frequently and the configuration hierarchy rebuilt when a change is detected.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcacheChangeEvent(PropStoreKey<?> eventPropKey)Signal that a cache change event occurred - cache change events occur on eviction or invalidation of the cache entry.voidconnectionEvent()A ZooKeeper connection event (session closed, expired...) and thatstatic PropSnapshotcreate(PropStoreKey<?> propStoreKey, PropStore propStore)voiddeleteEvent(PropStoreKey<?> eventPropKey)Signal that the node had been deleted from ZooKeeper.@NonNull VersionedPropertiesgetVersionedProperties()Get the current snapshot - updating if necessary.voidrequireUpdate()Signal the current snapshot is invalid and needs to be updated on next access.voidzkChangeEvent(PropStoreKey<?> eventPropKey)Signal that a ZooKeeper data change event occurred and that the data has changed.
-
-
-
Method Detail
-
create
public static PropSnapshot create(PropStoreKey<?> propStoreKey, PropStore propStore)
-
getVersionedProperties
public @NonNull VersionedProperties getVersionedProperties()
Get the current snapshot - updating if necessary.- Returns:
- the current property snapshot.
-
requireUpdate
public void requireUpdate()
Signal the current snapshot is invalid and needs to be updated on next access.
-
zkChangeEvent
public void zkChangeEvent(PropStoreKey<?> eventPropKey)
Description copied from interface:PropChangeListenerSignal that a ZooKeeper data change event occurred and that the data has changed.- Specified by:
zkChangeEventin interfacePropChangeListener
-
cacheChangeEvent
public void cacheChangeEvent(PropStoreKey<?> eventPropKey)
Description copied from interface:PropChangeListenerSignal that a cache change event occurred - cache change events occur on eviction or invalidation of the cache entry. The underlying data may or may not have changed.- Specified by:
cacheChangeEventin interfacePropChangeListener
-
deleteEvent
public void deleteEvent(PropStoreKey<?> eventPropKey)
Description copied from interface:PropChangeListenerSignal that the node had been deleted from ZooKeeper.- Specified by:
deleteEventin interfacePropChangeListener
-
connectionEvent
public void connectionEvent()
Description copied from interface:PropChangeListenerA ZooKeeper connection event (session closed, expired...) and that- Specified by:
connectionEventin interfacePropChangeListener
-
-