public class ConnectionWatcher extends Object implements org.apache.zookeeper.Watcher
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
LOGGER |
protected org.apache.zookeeper.ZooKeeper |
zk |
| Constructor and Description |
|---|
ConnectionWatcher(boolean debug) |
protected static final org.slf4j.Logger LOGGER
protected org.apache.zookeeper.ZooKeeper zk
public void connect(String hosts) throws IOException, InterruptedException
hosts - IOExceptionInterruptedExceptionpublic void process(org.apache.zookeeper.WatchedEvent event)
process in interface org.apache.zookeeper.Watcherpublic void reconnect()
public void close()
throws InterruptedException
InterruptedExceptionpublic org.apache.zookeeper.ZooKeeper getZk()
public void setZk(org.apache.zookeeper.ZooKeeper zk)
Copyright © 2015–2016 Baidu. All rights reserved.