org.apache.hadoop.hbase.zookeeper
Class ClusterStatusTracker

java.lang.Object
  extended by org.apache.hadoop.hbase.zookeeper.ZooKeeperListener
      extended by org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker
          extended by org.apache.hadoop.hbase.zookeeper.ClusterStatusTracker

public class ClusterStatusTracker
extends ZooKeeperNodeTracker

Tracker on cluster settings up in zookeeper. This is not related to 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.


Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker
abortable, node
 
Fields inherited from class org.apache.hadoop.hbase.zookeeper.ZooKeeperListener
watcher
 
Constructor Summary
ClusterStatusTracker(ZooKeeperWatcher watcher, Abortable abortable)
          Creates a cluster status tracker.
 
Method Summary
 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.
 
Methods inherited from class org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker
blockUntilAvailable, blockUntilAvailable, getData, getNode, nodeCreated, nodeDataChanged, nodeDeleted, start, stop
 
Methods inherited from class org.apache.hadoop.hbase.zookeeper.ZooKeeperListener
nodeChildrenChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClusterStatusTracker

public ClusterStatusTracker(ZooKeeperWatcher watcher,
                            Abortable abortable)
Creates a cluster status tracker.

After construction, use ZooKeeperNodeTracker.start() to kick off tracking.

Parameters:
watcher -
abortable -
Method Detail

isClusterUp

public boolean isClusterUp()
Checks if cluster is up.

Returns:
true if root region location is available, false if not

setClusterUp

public void setClusterUp()
                  throws org.apache.zookeeper.KeeperException
Sets the cluster as up.

Throws:
org.apache.zookeeper.KeeperException - unexpected zk exception

setClusterDown

public void setClusterDown()
                    throws org.apache.zookeeper.KeeperException
Sets the cluster as down by deleting the znode.

Throws:
org.apache.zookeeper.KeeperException - unexpected zk exception


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.