@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
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 org.apache.zookeeper.KeeperException
org.apache.zookeeper.KeeperException
- unexpected zk exceptionpublic void setClusterDown() throws org.apache.zookeeper.KeeperException
org.apache.zookeeper.KeeperException
- unexpected zk exceptionCopyright © 2014 The Apache Software Foundation. All rights reserved.