Class ZooKeeperWatcherBase

  • All Implemented Interfaces:
    org.apache.zookeeper.Watcher

    public class ZooKeeperWatcherBase
    extends java.lang.Object
    implements org.apache.zookeeper.Watcher
    Watcher for receiving zookeeper server connection events.
    • Nested Class Summary

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

        org.apache.zookeeper.Watcher.Event, org.apache.zookeeper.Watcher.WatcherType
    • Constructor Detail

      • ZooKeeperWatcherBase

        public ZooKeeperWatcherBase​(int zkSessionTimeOut,
                                    boolean allowReadOnlyMode)
      • ZooKeeperWatcherBase

        public ZooKeeperWatcherBase​(int zkSessionTimeOut,
                                    boolean allowReadOnlyMode,
                                    StatsLogger statsLogger)
      • ZooKeeperWatcherBase

        public ZooKeeperWatcherBase​(int zkSessionTimeOut,
                                    boolean allowReadOnlyMode,
                                    java.util.Set<org.apache.zookeeper.Watcher> childWatchers,
                                    StatsLogger statsLogger)
    • Method Detail

      • addChildWatcher

        public ZooKeeperWatcherBase addChildWatcher​(org.apache.zookeeper.Watcher watcher)
      • removeChildWatcher

        public ZooKeeperWatcherBase removeChildWatcher​(org.apache.zookeeper.Watcher watcher)
      • getStateCounter

        public Counter getStateCounter​(org.apache.zookeeper.Watcher.Event.KeeperState state)
      • process

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

        public void waitForConnection()
                               throws org.apache.zookeeper.KeeperException,
                                      java.lang.InterruptedException
        Waiting for the SyncConnected event from the ZooKeeper server.
        Throws:
        org.apache.zookeeper.KeeperException - when there is no connection
        java.lang.InterruptedException - interrupted while waiting for connection
      • getZkSessionTimeOut

        public int getZkSessionTimeOut()
        Return zookeeper session time out.