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 void
cacheChangeEvent(PropStoreKey<?> eventPropKey)
Signal that a cache change event occurred - cache change events occur on eviction or invalidation of the cache entry.void
connectionEvent()
A ZooKeeper connection event (session closed, expired...) and thatstatic PropSnapshot
create(PropStoreKey<?> propStoreKey, PropStore propStore)
void
deleteEvent(PropStoreKey<?> eventPropKey)
Signal that the node had been deleted from ZooKeeper.@NonNull VersionedProperties
getVersionedProperties()
Get the current snapshot - updating if necessary.void
requireUpdate()
Signal the current snapshot is invalid and needs to be updated on next access.void
zkChangeEvent(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:PropChangeListener
Signal that a ZooKeeper data change event occurred and that the data has changed.- Specified by:
zkChangeEvent
in interfacePropChangeListener
-
cacheChangeEvent
public void cacheChangeEvent(PropStoreKey<?> eventPropKey)
Description copied from interface:PropChangeListener
Signal 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:
cacheChangeEvent
in interfacePropChangeListener
-
deleteEvent
public void deleteEvent(PropStoreKey<?> eventPropKey)
Description copied from interface:PropChangeListener
Signal that the node had been deleted from ZooKeeper.- Specified by:
deleteEvent
in interfacePropChangeListener
-
connectionEvent
public void connectionEvent()
Description copied from interface:PropChangeListener
A ZooKeeper connection event (session closed, expired...) and that- Specified by:
connectionEvent
in interfacePropChangeListener
-
-