@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.Modifier and Type | Field and Description |
---|---|
private static org.apache.commons.logging.Log |
LOG |
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.
|
(package private) static byte[] |
toByteArray() |
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 org.apache.zookeeper.KeeperException
org.apache.zookeeper.KeeperException
- unexpected zk exceptionpublic void setClusterDown() throws org.apache.zookeeper.KeeperException
org.apache.zookeeper.KeeperException
- unexpected zk exceptionstatic byte[] toByteArray()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.