public class CombinedHostFileManager
extends org.apache.hadoop.hdfs.server.blockmanagement.HostConfigManager
CombinedHostsFileReader
for the json format.
Entries may or may not specify a port. If they don't, we consider
them to apply to every DataNode on that host. The code canonicalizes the
entries into IP addresses.
The code ignores all entries that the DNS fails to resolve their IP
addresses. This is okay because by default the NN rejects the registrations
of DNs when it fails to do a forward and reverse lookup. Note that DNS
resolutions are only done during the loading time to minimize the latency.Constructor and Description |
---|
CombinedHostFileManager() |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.conf.Configuration |
getConf() |
Iterable<InetSocketAddress> |
getExcludes()
Return all datanodes that should be in decommissioned state.
|
Iterable<InetSocketAddress> |
getIncludes()
Return all the datanodes that are allowed to connect to the namenode.
|
String |
getUpgradeDomain(org.apache.hadoop.hdfs.protocol.DatanodeID dn)
Get the upgrade domain of a datanode.
|
boolean |
isExcluded(org.apache.hadoop.hdfs.protocol.DatanodeID dn)
Check if a datanode needs to be decommissioned.
|
boolean |
isIncluded(org.apache.hadoop.hdfs.protocol.DatanodeID dn)
Check if a datanode is allowed to connect the namenode.
|
void |
refresh()
Reload the configuration.
|
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
public Iterable<InetSocketAddress> getIncludes()
org.apache.hadoop.hdfs.server.blockmanagement.HostConfigManager
getIncludes
in class org.apache.hadoop.hdfs.server.blockmanagement.HostConfigManager
public Iterable<InetSocketAddress> getExcludes()
org.apache.hadoop.hdfs.server.blockmanagement.HostConfigManager
getExcludes
in class org.apache.hadoop.hdfs.server.blockmanagement.HostConfigManager
public void setConf(org.apache.hadoop.conf.Configuration conf)
public org.apache.hadoop.conf.Configuration getConf()
public void refresh() throws IOException
org.apache.hadoop.hdfs.server.blockmanagement.HostConfigManager
refresh
in class org.apache.hadoop.hdfs.server.blockmanagement.HostConfigManager
IOException
public boolean isIncluded(org.apache.hadoop.hdfs.protocol.DatanodeID dn)
org.apache.hadoop.hdfs.server.blockmanagement.HostConfigManager
isIncluded
in class org.apache.hadoop.hdfs.server.blockmanagement.HostConfigManager
dn
- the DatanodeID of the datanodepublic boolean isExcluded(org.apache.hadoop.hdfs.protocol.DatanodeID dn)
org.apache.hadoop.hdfs.server.blockmanagement.HostConfigManager
isExcluded
in class org.apache.hadoop.hdfs.server.blockmanagement.HostConfigManager
dn
- the DatanodeID of the datanodepublic String getUpgradeDomain(org.apache.hadoop.hdfs.protocol.DatanodeID dn)
org.apache.hadoop.hdfs.server.blockmanagement.HostConfigManager
getUpgradeDomain
in class org.apache.hadoop.hdfs.server.blockmanagement.HostConfigManager
dn
- the DatanodeID of the datanodeCopyright © 2017 Apache Software Foundation. All Rights Reserved.