org.apache.hadoop.hbase.zookeeper
Class DrainingServerTracker

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

@InterfaceAudience.Private
public class DrainingServerTracker
extends ZooKeeperListener

Tracks the list of draining region servers via ZK.

This class is responsible for watching for changes to the draining servers list. It handles adds/deletes in the draining RS list and watches each node.

If an RS gets deleted from draining list, we call ServerManager.removeServerFromDrainList(ServerName)

If an RS gets added to the draining list, we add a watcher to it and call ServerManager.addServerToDrainList(ServerName)


Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.zookeeper.ZooKeeperListener
watcher
 
Constructor Summary
DrainingServerTracker(ZooKeeperWatcher watcher, Abortable abortable, ServerManager serverManager)
           
 
Method Summary
 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 draining RegionServers.
 
Methods inherited from class org.apache.hadoop.hbase.zookeeper.ZooKeeperListener
getWatcher, nodeCreated, nodeDataChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrainingServerTracker

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

start

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

All Draining RSs will be tracked after this method is called.

Throws:
org.apache.zookeeper.KeeperException
IOException

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


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.