@InterfaceAudience.Private public class DrainingServerTracker extends ZKListener
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)
 
This class is deprecated in 2.0 because decommission/draining API goes through master in 2.0. Can remove this class in 3.0.
| Modifier and Type | Field and Description | 
|---|---|
| private Abortable | abortable | 
| private NavigableSet<ServerName> | drainingServers | 
| private static org.slf4j.Logger | LOG | 
| private ServerManager | serverManager | 
watcher| Constructor and Description | 
|---|
| DrainingServerTracker(ZKWatcher watcher,
                     Abortable abortable,
                     ServerManager serverManager) | 
| Modifier and Type | Method and Description | 
|---|---|
| private void | add(List<String> 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 | 
| private void | remove(ServerName sn) | 
| void | start()Starts the tracking of draining RegionServers. | 
getWatcher, nodeCreated, nodeDataChangedprivate static final org.slf4j.Logger LOG
private ServerManager serverManager
private final NavigableSet<ServerName> drainingServers
public DrainingServerTracker(ZKWatcher watcher, Abortable abortable, ServerManager serverManager)
public void start() throws org.apache.zookeeper.KeeperException, IOException
All Draining RSs will be tracked after this method is called.
org.apache.zookeeper.KeeperExceptionIOExceptionprivate void add(List<String> servers) throws IOException
IOExceptionprivate void remove(ServerName sn)
public void nodeDeleted(String path)
ZKListenernodeDeleted in class ZKListenerpath - full path of the deleted nodepublic void nodeChildrenChanged(String path)
ZKListenernodeChildrenChanged in class ZKListenerpath - full path of the node whose children have changedCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.