@InterfaceAudience.Private public class ClusterStatusTracker extends ZooKeeperNodeTracker
ClusterStatus
.
That class is a data structure that holds snapshot of current view on cluster.
This class is about tracking cluster attributes up in zookeeper.abortable, node
watcher
Constructor and Description |
---|
ClusterStatusTracker(ZooKeeperWatcher watcher,
Abortable abortable)
Creates a cluster status tracker.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isClusterUp()
Checks if cluster is up.
|
void |
setClusterDown()
Sets the cluster as down by deleting the znode.
|
void |
setClusterUp()
Sets the cluster as up.
|
blockUntilAvailable, blockUntilAvailable, checkIfBaseNodeAvailable, getData, getNode, nodeCreated, nodeDataChanged, nodeDeleted, start, stop, toString
getWatcher, nodeChildrenChanged
public ClusterStatusTracker(ZooKeeperWatcher watcher, Abortable abortable)
After construction, use ZooKeeperNodeTracker.start()
to kick off tracking.
watcher
- abortable
- public boolean isClusterUp()
public void setClusterUp() throws KeeperException
KeeperException
- unexpected zk exceptionpublic void setClusterDown() throws KeeperException
KeeperException
- unexpected zk exception