Class 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 Detail

      • 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.
      • 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 interface PropChangeListener