Class HostConfigManager

java.lang.Object
org.apache.hadoop.hdfs.server.blockmanagement.HostConfigManager
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
Direct Known Subclasses:
CombinedHostFileManager, HostFileManager

@Private @Unstable public abstract class HostConfigManager extends Object implements org.apache.hadoop.conf.Configurable
This interface abstracts how datanode configuration is managed. Each implementation defines its own way to persist the configuration. For example, it can use one JSON file to store the configs for all datanodes; or it can use one file to store in-service datanodes and another file to store decommission-requested datanodes. These files control which DataNodes the NameNode expects to see in the cluster.
  • Constructor Details

    • HostConfigManager

      public HostConfigManager()
  • Method Details

    • getIncludes

      public abstract Iterable<InetSocketAddress> getIncludes()
      Return all the datanodes that are allowed to connect to the namenode.
      Returns:
      Iterable of all datanodes
    • getExcludes

      public abstract Iterable<InetSocketAddress> getExcludes()
      Return all datanodes that should be in decommissioned state.
      Returns:
      Iterable of those datanodes
    • isIncluded

      public abstract boolean isIncluded(org.apache.hadoop.hdfs.protocol.DatanodeID dn)
      Check if a datanode is allowed to connect the namenode.
      Parameters:
      dn - the DatanodeID of the datanode
      Returns:
      boolean if dn is allowed to connect the namenode.
    • isExcluded

      public abstract boolean isExcluded(org.apache.hadoop.hdfs.protocol.DatanodeID dn)
      Check if a datanode needs to be decommissioned.
      Parameters:
      dn - the DatanodeID of the datanode
      Returns:
      boolean if dn needs to be decommissioned.
    • refresh

      public abstract void refresh() throws IOException
      Reload the configuration.
      Throws:
      IOException
    • getUpgradeDomain

      public abstract String getUpgradeDomain(org.apache.hadoop.hdfs.protocol.DatanodeID dn)
      Get the upgrade domain of a datanode.
      Parameters:
      dn - the DatanodeID of the datanode
      Returns:
      the upgrade domain of dn.
    • getMaintenanceExpirationTimeInMS

      public abstract long getMaintenanceExpirationTimeInMS(org.apache.hadoop.hdfs.protocol.DatanodeID dn)
      Get the maintenance expiration time in milli seconds.
      Parameters:
      dn - the DatanodeID of the datanode
      Returns:
      the maintenance expiration time of dn.