Interface CuratorCacheAccessor

All Known Subinterfaces:
CuratorCache, CuratorCacheBridge, CuratorCacheStorage

public interface CuratorCacheAccessor
Methods to access the underlying storage
  • Method Details

    • get

      Return an entry from storage
      Parameters:
      path - path to get
      Returns:
      entry or empty()
    • size

      int size()
      Return the current number of entries in storage
      Returns:
      number of entries
    • stream

      Stream<ChildData> stream()
      Return a stream over the storage entries. Note: for a standard storage instance, the stream behaves like a stream returned by ConcurrentHashMap.entrySet()
      Returns:
      stream over entries
    • parentPathFilter

      static Predicate<ChildData> parentPathFilter(String parentPath)
      Filter for a ChildData stream. Only ChildDatas with the given parent path pass the filter. This is useful to stream one level below a given path in the cache. e.g. to stream only the first level below the root of the cache.
       CuratorCache cache = ...
       cache.stream().filter(parentPathFilter(root))... // etc
       
      Parameters:
      parentPath - the parent path to filter on
      Returns:
      filtered stream