Class ClusterStatusTracker
java.lang.Object
org.apache.hadoop.hbase.zookeeper.ZKListener
org.apache.hadoop.hbase.zookeeper.ZKNodeTracker
org.apache.hadoop.hbase.zookeeper.ClusterStatusTracker
Tracker on cluster settings up in zookeeper. This is not related to
ClusterMetrics. That class is a data structure that holds
snapshot of current view on cluster. This class is about tracking cluster attributes up in
zookeeper.-
Field Summary
FieldsFields inherited from class org.apache.hadoop.hbase.zookeeper.ZKNodeTracker
abortable, nodeFields inherited from class org.apache.hadoop.hbase.zookeeper.ZKListener
watcher -
Constructor Summary
ConstructorsConstructorDescriptionClusterStatusTracker(ZKWatcher watcher, Abortable abortable) Creates a cluster status tracker. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if cluster is up.voidSets the cluster as down by deleting the znode.voidSets the cluster as up.(package private) static byte[]Returns Content of the clusterup znode as a serialized pb with the pb magic as prefix.Methods inherited from class org.apache.hadoop.hbase.zookeeper.ZKNodeTracker
blockUntilAvailable, blockUntilAvailable, checkIfBaseNodeAvailable, getData, getNode, nodeCreated, nodeDataChanged, nodeDeleted, postStart, start, stop, toStringMethods inherited from class org.apache.hadoop.hbase.zookeeper.ZKListener
getWatcher, nodeChildrenChanged
-
Field Details
-
LOG
-
-
Constructor Details
-
ClusterStatusTracker
Creates a cluster status tracker.After construction, use
ZKNodeTracker.start()to kick off tracking.- Parameters:
watcher- reference to theZKWatcherwhich also contains configuration and constantsabortable- used to abort if a fatal error occurs
-
-
Method Details
-
isClusterUp
Checks if cluster is up.- Returns:
- true if the cluster up ('shutdown' is its name up in zk) znode exists with data, false if not
-
setClusterUp
Sets the cluster as up.- Throws:
org.apache.zookeeper.KeeperException- unexpected zk exception
-
setClusterDown
Sets the cluster as down by deleting the znode.- Throws:
org.apache.zookeeper.KeeperException- unexpected zk exception
-
toByteArray
Returns Content of the clusterup znode as a serialized pb with the pb magic as prefix.
-