DatanodeAdminMonitorBase (Apache Hadoop HDFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.blockmanagement, class: DatanodeAdminMonitorBase

Package org.apache.hadoop.hdfs.server.blockmanagement

# 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

  Fields
  Modifier and Type
  Field
  Description
  `protected BlockManager`
  `blockManager`
  `protected org.apache.hadoop.conf.Configuration`
  `conf`
  `protected DatanodeAdminManager`
  `dnAdmin`
  `protected int`
  `maxConcurrentTrackedNodes`
  The maximum number of nodes to track in outOfServiceNodeBlocks.
  `protected Namesystem`
  `namesystem`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DatanodeAdminMonitorBase()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Queue<DatanodeDescriptor>`
  `getCancelledNodes()`
  `org.apache.hadoop.conf.Configuration`
  `getConf()`
  Get the current Configuration stored in this object.
  `int`
  `getPendingNodeCount()`
  Get the number of datanodes nodes in the pending queue.
  `Queue<DatanodeDescriptor>`
  `getPendingNodes()`
  `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.
  `void`
  `setBlockManager(BlockManager bm)`
  Set the blockmanager for the cluster.
  `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.
  `void`
  `setDatanodeAdminManager(DatanodeAdminManager admin)`
  Set the DatanodeAdminManager instance in use in the namenode.
  `void`
  `setNameSystem(Namesystem ns)`
  Set the cluster namesystem.
  `void`
  `startTrackingNode(DatanodeDescriptor dn)`
  Start tracking a node for decommission or maintenance.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface org.apache.hadoop.hdfs.server.blockmanagement.DatanodeAdminMonitorInterface

  `getBlocksPerLock, getNumNodesChecked, getPendingRepLimit, getTrackedNodeCount, setBlocksPerLock, setPendingRepLimit, stopTrackingNode`

  ### Methods inherited from interface java.lang.Runnable

  `run`

- ## Field Details

  - ### blockManager

    protected BlockManager blockManager

  - ### namesystem

    protected Namesystem namesystem

  - ### dnAdmin

    protected DatanodeAdminManager dnAdmin

  - ### conf

    protected org.apache.hadoop.conf.Configuration conf

  - ### maxConcurrentTrackedNodes

    protected int maxConcurrentTrackedNodes
    The maximum number of nodes to track in outOfServiceNodeBlocks. A value of 0 means no limit.

- ## Constructor Details

  - ### DatanodeAdminMonitorBase

    public DatanodeAdminMonitorBase()

- ## Method Details

  - ### setNameSystem

    public void setNameSystem(Namesystem ns)
    Set the cluster namesystem.
    Specified by:
      `setNameSystem` in interface `DatanodeAdminMonitorInterface`
    Parameters:
      `ns` - The namesystem for the cluster

  - ### setBlockManager

    public void setBlockManager(BlockManager bm)
    Set the blockmanager for the cluster.
    Specified by:
      `setBlockManager` in interface `DatanodeAdminMonitorInterface`
    Parameters:
      `bm` - The cluster BlockManager

  - ### setDatanodeAdminManager

    public void setDatanodeAdminManager(DatanodeAdminManager admin)
    Set the DatanodeAdminManager instance in use in the namenode.
    Specified by:
      `setDatanodeAdminManager` in interface `DatanodeAdminMonitorInterface`
    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:
      `setConf` in interface `org.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:
      `getConf` in interface `org.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

    public void startTrackingNode(DatanodeDescriptor dn)
    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:
      `startTrackingNode` in interface `DatanodeAdminMonitorInterface`
    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:
      `getPendingNodeCount` in interface `DatanodeAdminMonitorInterface`
    Returns:
      The count of pending nodes

  - ### getPendingNodes

    public Queue<DatanodeDescriptor> getPendingNodes()
    Specified by:
      `getPendingNodes` in interface `DatanodeAdminMonitorInterface`

  - ### getCancelledNodes

    public Queue<DatanodeDescriptor> getCancelledNodes()
    Specified by:
      `getCancelledNodes` in interface `DatanodeAdminMonitorInterface`