Class DatanodeAdminMonitorBase
java.lang.Object
org.apache.hadoop.hdfs.server.blockmanagement.DatanodeAdminMonitorBase
- All Implemented Interfaces:
Runnable,org.apache.hadoop.conf.Configurable,DatanodeAdminMonitorInterface
- Direct Known Subclasses:
DatanodeAdminBackoffMonitor,DatanodeAdminDefaultMonitor
public abstract class DatanodeAdminMonitorBase
extends Object
implements DatanodeAdminMonitorInterface, org.apache.hadoop.conf.Configurable
This abstract class provides some base methods which are inherited by
the DatanodeAdmin BackOff and Default Monitors, which control decommission
and maintenance mode.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BlockManagerprotected org.apache.hadoop.conf.Configurationprotected DatanodeAdminManagerprotected intThe maximum number of nodes to track in outOfServiceNodeBlocks.protected Namesystem -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.conf.ConfigurationgetConf()Get the current Configuration stored in this object.intGet the number of datanodes nodes in the pending queue.protected abstract voidAbstract method which must be implemented by the sub-classes to process set various instance variables from the Configuration passed at object creation time.voidSet the blockmanager for the cluster.voidsetConf(org.apache.hadoop.conf.Configuration conf) Used by the Configurable interface, which is used by ReflectionUtils to create an instance of the monitor class.voidSet the DatanodeAdminManager instance in use in the namenode.voidSet the cluster namesystem.voidStart tracking a node for decommission or maintenance.Methods 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
getBlocksPerLock, getNumNodesChecked, getPendingRepLimit, getTrackedNodeCount, setBlocksPerLock, setPendingRepLimit, stopTrackingNode
-
Field Details
-
blockManager
-
namesystem
-
dnAdmin
-
conf
protected org.apache.hadoop.conf.Configuration conf -
maxConcurrentTrackedNodes
protected int maxConcurrentTrackedNodesThe maximum number of nodes to track in outOfServiceNodeBlocks. A value of 0 means no limit.
-
-
Constructor Details
-
DatanodeAdminMonitorBase
public DatanodeAdminMonitorBase()
-
-
Method Details
-
setNameSystem
Set the cluster namesystem.- Specified by:
setNameSystemin interfaceDatanodeAdminMonitorInterface- Parameters:
ns- The namesystem for the cluster
-
setBlockManager
Set the blockmanager for the cluster.- Specified by:
setBlockManagerin interfaceDatanodeAdminMonitorInterface- Parameters:
bm- The cluster BlockManager
-
setDatanodeAdminManager
Set the DatanodeAdminManager instance in use in the namenode.- Specified by:
setDatanodeAdminManagerin interfaceDatanodeAdminMonitorInterface- Parameters:
admin- The current DatanodeAdminManager
-
setConf
public void setConf(org.apache.hadoop.conf.Configuration conf) Used by the Configurable interface, which is used by ReflectionUtils to create an instance of the monitor class. This method will be called to pass the Configuration to the new object.- Specified by:
setConfin interfaceorg.apache.hadoop.conf.Configurable- Parameters:
conf- configuration to be used
-
getConf
public org.apache.hadoop.conf.Configuration getConf()Get the current Configuration stored in this object.- Specified by:
getConfin interfaceorg.apache.hadoop.conf.Configurable- Returns:
- Configuration used when the object was created
-
processConf
protected abstract void processConf()Abstract method which must be implemented by the sub-classes to process set various instance variables from the Configuration passed at object creation time. -
startTrackingNode
Start tracking a node for decommission or maintenance. The given Datanode will be queued for later processing in pendingNodes. This method must be called under the namenode write lock.- Specified by:
startTrackingNodein interfaceDatanodeAdminMonitorInterface- Parameters:
dn- The datanode to start tracking
-
getPendingNodeCount
public int getPendingNodeCount()Get the number of datanodes nodes in the pending queue. Ie the count of nodes waiting to decommission but have not yet started the process.- Specified by:
getPendingNodeCountin interfaceDatanodeAdminMonitorInterface- Returns:
- The count of pending nodes
-
getPendingNodes
- Specified by:
getPendingNodesin interfaceDatanodeAdminMonitorInterface
-
getCancelledNodes
- Specified by:
getCancelledNodesin interfaceDatanodeAdminMonitorInterface
-