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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Iterable<InetSocketAddress>Return all datanodes that should be in decommissioned state.abstract Iterable<InetSocketAddress>Return all the datanodes that are allowed to connect to the namenode.abstract longgetMaintenanceExpirationTimeInMS(org.apache.hadoop.hdfs.protocol.DatanodeID dn) Get the maintenance expiration time in milli seconds.abstract StringgetUpgradeDomain(org.apache.hadoop.hdfs.protocol.DatanodeID dn) Get the upgrade domain of a datanode.abstract booleanisExcluded(org.apache.hadoop.hdfs.protocol.DatanodeID dn) Check if a datanode needs to be decommissioned.abstract booleanisIncluded(org.apache.hadoop.hdfs.protocol.DatanodeID dn) Check if a datanode is allowed to connect the namenode.abstract voidrefresh()Reload the configuration.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
-
Constructor Details
-
HostConfigManager
public HostConfigManager()
-
-
Method Details
-
getIncludes
Return all the datanodes that are allowed to connect to the namenode.- Returns:
- Iterable of all datanodes
-
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
Reload the configuration.- Throws:
IOException
-
getUpgradeDomain
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.
-