org.apache.hadoop.hbase.zookeeper
Class RegionServerTracker

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

public class RegionServerTracker
extends ZooKeeperListener

Tracks the online region servers via ZK.

Handling of new RSs checking in is done via RPC. This class is only responsible for watching for expired nodes. It handles listening for changes in the RS node list and watching each node.

If an RS node gets deleted, this automatically handles calling of ServerManager.expireServer(org.apache.hadoop.hbase.HServerInfo).


Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.zookeeper.ZooKeeperListener
watcher
 
Constructor Summary
RegionServerTracker(ZooKeeperWatcher watcher, Abortable abortable, ServerManager serverManager)
           
 
Method Summary
 List<HServerAddress> getOnlineServers()
          Gets the online servers.
 void nodeChildrenChanged(String path)
          Called when an existing node has a child node added or removed.
 void nodeDeleted(String path)
          Called when a node has been deleted
 void start()
          Starts the tracking of online RegionServers.
 
Methods inherited from class org.apache.hadoop.hbase.zookeeper.ZooKeeperListener
nodeCreated, nodeDataChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegionServerTracker

public RegionServerTracker(ZooKeeperWatcher watcher,
                           Abortable abortable,
                           ServerManager serverManager)
Method Detail

start

public void start()
           throws org.apache.zookeeper.KeeperException
Starts the tracking of online RegionServers.

All RSs will be tracked after this method is called.

Throws:
org.apache.zookeeper.KeeperException

nodeDeleted

public void nodeDeleted(String path)
Description copied from class: ZooKeeperListener
Called when a node has been deleted

Overrides:
nodeDeleted in class ZooKeeperListener
Parameters:
path - full path of the deleted node

nodeChildrenChanged

public void nodeChildrenChanged(String path)
Description copied from class: ZooKeeperListener
Called when an existing node has a child node added or removed.

Overrides:
nodeChildrenChanged in class ZooKeeperListener
Parameters:
path - full path of the node whose children have changed

getOnlineServers

public List<HServerAddress> getOnlineServers()
                                      throws org.apache.zookeeper.KeeperException
Gets the online servers.

Returns:
list of online servers from zk
Throws:
org.apache.zookeeper.KeeperException


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