Class ZooKeeperChildrenCache

  • All Implemented Interfaces:
    ZooKeeperCache.CacheUpdater<java.util.Set<java.lang.String>>, org.apache.zookeeper.Watcher

    public class ZooKeeperChildrenCache
    extends java.lang.Object
    implements org.apache.zookeeper.Watcher, ZooKeeperCache.CacheUpdater<java.util.Set<java.lang.String>>
    This class keeps a cache of the children for several z-nodes and updates it whenever it's changed on zookeeper.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.apache.zookeeper.Watcher

        org.apache.zookeeper.Watcher.Event, org.apache.zookeeper.Watcher.WatcherType
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      void close()  
      java.util.Set<java.lang.String> get()  
      java.util.Set<java.lang.String> get​(java.lang.String path)  
      java.util.concurrent.CompletableFuture<java.util.Set<java.lang.String>> getAsync()  
      java.util.concurrent.CompletableFuture<java.util.Set<java.lang.String>> getAsync​(java.lang.String path)  
      void process​(org.apache.zookeeper.WatchedEvent event)  
      void registerListener​(ZooKeeperCacheListener<java.util.Set<java.lang.String>> listener)  
      void reloadCache​(java.lang.String path)  
      void unregisterListener​(ZooKeeperCacheListener<java.util.Set<java.lang.String>> listener)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ZooKeeperChildrenCache

        public ZooKeeperChildrenCache​(ZooKeeperCache cache,
                                      java.lang.String path)
    • Method Detail

      • get

        public java.util.Set<java.lang.String> get()
                                            throws org.apache.zookeeper.KeeperException,
                                                   java.lang.InterruptedException
        Throws:
        org.apache.zookeeper.KeeperException
        java.lang.InterruptedException
      • get

        public java.util.Set<java.lang.String> get​(java.lang.String path)
                                            throws org.apache.zookeeper.KeeperException,
                                                   java.lang.InterruptedException
        Throws:
        org.apache.zookeeper.KeeperException
        java.lang.InterruptedException
      • getAsync

        public java.util.concurrent.CompletableFuture<java.util.Set<java.lang.String>> getAsync()
      • getAsync

        public java.util.concurrent.CompletableFuture<java.util.Set<java.lang.String>> getAsync​(java.lang.String path)
      • clear

        public void clear()
      • process

        public void process​(org.apache.zookeeper.WatchedEvent event)
        Specified by:
        process in interface org.apache.zookeeper.Watcher
      • close

        public void close()