Package org.apache.bookkeeper.zookeeper
Class ZooKeeperWatcherBase
- java.lang.Object
-
- org.apache.bookkeeper.zookeeper.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.
-
-
Constructor Summary
Constructors Constructor Description ZooKeeperWatcherBase(int zkSessionTimeOut, boolean allowReadOnlyMode)
ZooKeeperWatcherBase(int zkSessionTimeOut, boolean allowReadOnlyMode, java.util.Set<org.apache.zookeeper.Watcher> childWatchers, StatsLogger statsLogger)
ZooKeeperWatcherBase(int zkSessionTimeOut, boolean allowReadOnlyMode, StatsLogger statsLogger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ZooKeeperWatcherBase
addChildWatcher(org.apache.zookeeper.Watcher watcher)
Counter
getStateCounter(org.apache.zookeeper.Watcher.Event.KeeperState state)
int
getZkSessionTimeOut()
Return zookeeper session time out.void
process(org.apache.zookeeper.WatchedEvent event)
ZooKeeperWatcherBase
removeChildWatcher(org.apache.zookeeper.Watcher watcher)
void
waitForConnection()
Waiting for the SyncConnected event from the ZooKeeper server.
-
-
-
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 interfaceorg.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 connectionjava.lang.InterruptedException
- interrupted while waiting for connection
-
getZkSessionTimeOut
public int getZkSessionTimeOut()
Return zookeeper session time out.
-
-