@InterfaceAudience.Private public class ClusterStatusTracker extends ZKNodeTracker
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(ZKWatcher 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(ZKWatcher watcher, Abortable abortable)
After construction, use ZKNodeTracker.start()
to kick off tracking.
watcher
- reference to the ZKWatcher
which also contains configuration and
constantsabortable
- used to abort if a fatal error occurspublic 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 © 2007–2019 Cloudera. All rights reserved.