public class ZooKeeperConnection extends Object
| Constructor and Description |
|---|
ZooKeeperConnection(String quorumAddresses) |
ZooKeeperConnection(org.apache.zookeeper.ZooKeeper zookeeper) |
| Modifier and Type | Method and Description |
|---|---|
void |
deregisterObserver(ZooKeeperConnectionObserver observer) |
org.apache.zookeeper.ZooKeeper |
get() |
void |
registerObserver(ZooKeeperConnectionObserver observer) |
void |
reset()
Remove any preexisting ZooKeeper connection instance.
|
void |
shutdown() |
public ZooKeeperConnection(org.apache.zookeeper.ZooKeeper zookeeper)
public ZooKeeperConnection(String quorumAddresses) throws IOException
IOExceptionpublic org.apache.zookeeper.ZooKeeper get()
public void shutdown()
public void registerObserver(ZooKeeperConnectionObserver observer)
public void deregisterObserver(ZooKeeperConnectionObserver observer)
public void reset()
This method should be called when the connection to the ZooKeeper is expired, so a subsequent call to
get() will establish a new connection.
Copyright © 2014–2016 Lable. All rights reserved.