Class DatanodeAdminBackoffMonitor
java.lang.Object
org.apache.hadoop.hdfs.server.blockmanagement.DatanodeAdminMonitorBase
org.apache.hadoop.hdfs.server.blockmanagement.DatanodeAdminBackoffMonitor
- All Implemented Interfaces:
Runnable,org.apache.hadoop.conf.Configurable,DatanodeAdminMonitorInterface
public class DatanodeAdminBackoffMonitor
extends DatanodeAdminMonitorBase
implements DatanodeAdminMonitorInterface
This class implements the logic to track decommissioning and entering
maintenance nodes, ensure all their blocks are adequately replicated
before they are moved to the decommissioned or maintenance state.
This monitor avoids flooding the replication queue with all pending blocks
and instead feeds them to the queue as the prior set complete replication.
HDFS-14854 contains details about the overall design of this class.
-
Field Summary
Fields inherited from class org.apache.hadoop.hdfs.server.blockmanagement.DatanodeAdminMonitorBase
blockManager, conf, dnAdmin, maxConcurrentTrackedNodes, namesystem -
Method Summary
Modifier and TypeMethodDescriptionintintintintprotected voidAbstract method which must be implemented by the sub-classes to process set various instance variables from the Configuration passed at object creation time.voidrun()voidsetBlocksPerLock(int blocksPerLock) voidsetPendingRepLimit(int pendingRepLimit) voidQueue a node to be removed from tracking.Methods inherited from class org.apache.hadoop.hdfs.server.blockmanagement.DatanodeAdminMonitorBase
getCancelledNodes, getConf, getPendingNodeCount, getPendingNodes, setBlockManager, setConf, setDatanodeAdminManager, setNameSystem, startTrackingNodeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.hdfs.server.blockmanagement.DatanodeAdminMonitorInterface
getCancelledNodes, getPendingNodeCount, getPendingNodes, setBlockManager, setDatanodeAdminManager, setNameSystem, startTrackingNode
-
Method Details
-
processConf
protected void processConf()Description copied from class:DatanodeAdminMonitorBaseAbstract method which must be implemented by the sub-classes to process set various instance variables from the Configuration passed at object creation time.- Specified by:
processConfin classDatanodeAdminMonitorBase
-
stopTrackingNode
Queue a node to be removed from tracking. This method must be called under the namenode write lock.- Specified by:
stopTrackingNodein interfaceDatanodeAdminMonitorInterface- Parameters:
dn- The datanode to stop tracking for decommission.
-
getTrackedNodeCount
public int getTrackedNodeCount()- Specified by:
getTrackedNodeCountin interfaceDatanodeAdminMonitorInterface
-
getNumNodesChecked
public int getNumNodesChecked()- Specified by:
getNumNodesCheckedin interfaceDatanodeAdminMonitorInterface
-
run
public void run() -
getPendingRepLimit
@VisibleForTesting public int getPendingRepLimit()- Specified by:
getPendingRepLimitin interfaceDatanodeAdminMonitorInterface
-
setPendingRepLimit
public void setPendingRepLimit(int pendingRepLimit) - Specified by:
setPendingRepLimitin interfaceDatanodeAdminMonitorInterface
-
getBlocksPerLock
@VisibleForTesting public int getBlocksPerLock()- Specified by:
getBlocksPerLockin interfaceDatanodeAdminMonitorInterface
-
setBlocksPerLock
public void setBlocksPerLock(int blocksPerLock) - Specified by:
setBlocksPerLockin interfaceDatanodeAdminMonitorInterface
-