Class ZooKeeperDataCache<T>

    • 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()
      Only for UTs (for now), as this clears the whole ZK data cache.
      void close()  
      java.util.Optional<T> get​(java.lang.String path)
      Return an item from the cache If node doens't exist, the value will be not present.s
      java.util.concurrent.CompletableFuture<java.util.Optional<T>> getAsync​(java.lang.String path)  
      T getDataIfPresent​(java.lang.String path)  
      java.util.Optional<java.util.Map.Entry<T,​org.apache.zookeeper.data.Stat>> getWithStat​(java.lang.String path)  
      java.util.concurrent.CompletableFuture<java.util.Optional<java.util.Map.Entry<T,​org.apache.zookeeper.data.Stat>>> getWithStatAsync​(java.lang.String path)  
      void invalidate​(java.lang.String path)  
      void process​(org.apache.zookeeper.WatchedEvent event)  
      void registerListener​(ZooKeeperCacheListener<T> listener)  
      void reloadCache​(java.lang.String path)  
      void unregisterListener​(ZooKeeperCacheListener<T> listener)  
      • Methods inherited from class java.lang.Object

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

      • ZooKeeperDataCache

        public ZooKeeperDataCache​(ZooKeeperCache cache)
    • Method Detail

      • getAsync

        public java.util.concurrent.CompletableFuture<java.util.Optional<T>> getAsync​(java.lang.String path)
      • getWithStatAsync

        public java.util.concurrent.CompletableFuture<java.util.Optional<java.util.Map.Entry<T,​org.apache.zookeeper.data.Stat>>> getWithStatAsync​(java.lang.String path)
      • get

        public java.util.Optional<T> get​(java.lang.String path)
                                  throws java.lang.Exception
        Return an item from the cache If node doens't exist, the value will be not present.s
        Parameters:
        path -
        Returns:
        Throws:
        java.lang.Exception
      • getWithStat

        public java.util.Optional<java.util.Map.Entry<T,​org.apache.zookeeper.data.Stat>> getWithStat​(java.lang.String path)
                                                                                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • clear

        public void clear()
        Only for UTs (for now), as this clears the whole ZK data cache.
      • invalidate

        public void invalidate​(java.lang.String path)
      • process

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

        public T getDataIfPresent​(java.lang.String path)
      • close

        public void close()