Class ZooKeeperWatcherBase

java.lang.Object
org.apache.bookkeeper.zookeeper.ZooKeeperWatcherBase
All Implemented Interfaces:
org.apache.zookeeper.Watcher

public class ZooKeeperWatcherBase extends Object implements org.apache.zookeeper.Watcher
Watcher for receiving zookeeper server connection events.
  • Constructor Details

    • ZooKeeperWatcherBase

      public ZooKeeperWatcherBase(int zkSessionTimeOut, boolean allowReadOnlyMode)
    • ZooKeeperWatcherBase

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

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

    • 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, InterruptedException
      Waiting for the SyncConnected event from the ZooKeeper server.
      Throws:
      org.apache.zookeeper.KeeperException - when there is no connection
      InterruptedException - interrupted while waiting for connection
    • getZkSessionTimeOut

      public int getZkSessionTimeOut()
      Return zookeeper session time out.