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 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