Class DefaultSubClusterResolverImpl
java.lang.Object
org.apache.hadoop.yarn.server.federation.resolver.AbstractSubClusterResolver
org.apache.hadoop.yarn.server.federation.resolver.DefaultSubClusterResolverImpl
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable,SubClusterResolver
public class DefaultSubClusterResolverImpl
extends AbstractSubClusterResolver
implements SubClusterResolver
Default simple sub-cluster and rack resolver class.
This class expects a three-column comma separated file, specified in
yarn.federation.machine-list. Each line of the file should be of the format:
nodeName, subClusterId, rackName
Lines that do not follow this format will be ignored. This resolver only
loads the file when load() is explicitly called; it will not react to changes
to the file.
It is case-insensitive on the rack and node names and ignores
leading/trailing whitespace.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.conf.ConfigurationgetConf()getSubClusterForNode(String nodename) Obtain the sub-cluster that a specified node belongs to.getSubClustersForRack(String rackname) Obtain the sub-clusters that have nodes on a specified rack.voidload()Load the nodes to subCluster mapping from the file.voidsetConf(org.apache.hadoop.conf.Configuration conf) Methods inherited from class org.apache.hadoop.yarn.server.federation.resolver.AbstractSubClusterResolver
getNodeToSubCluster, getRackToSubClusters
-
Constructor Details
-
DefaultSubClusterResolverImpl
public DefaultSubClusterResolverImpl()
-
-
Method Details
-
setConf
public void setConf(org.apache.hadoop.conf.Configuration conf) - Specified by:
setConfin interfaceorg.apache.hadoop.conf.Configurable
-
getConf
public org.apache.hadoop.conf.Configuration getConf()- Specified by:
getConfin interfaceorg.apache.hadoop.conf.Configurable
-
getSubClusterForNode
public SubClusterId getSubClusterForNode(String nodename) throws org.apache.hadoop.yarn.exceptions.YarnException Description copied from interface:SubClusterResolverObtain the sub-cluster that a specified node belongs to.- Specified by:
getSubClusterForNodein interfaceSubClusterResolver- Overrides:
getSubClusterForNodein classAbstractSubClusterResolver- Parameters:
nodename- the node whose sub-cluster is to be determined- Returns:
- the sub-cluster as identified by the
SubClusterIdthat the node belongs to - Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the node's sub-cluster cannot be resolved
-
load
public void load()Description copied from interface:SubClusterResolverLoad the nodes to subCluster mapping from the file.- Specified by:
loadin interfaceSubClusterResolver
-
getSubClustersForRack
public Set<SubClusterId> getSubClustersForRack(String rackname) throws org.apache.hadoop.yarn.exceptions.YarnException Description copied from interface:SubClusterResolverObtain the sub-clusters that have nodes on a specified rack.- Specified by:
getSubClustersForRackin interfaceSubClusterResolver- Overrides:
getSubClustersForRackin classAbstractSubClusterResolver- Parameters:
rackname- the name of the rack- Returns:
- the sub-clusters as identified by the
SubClusterIdthat have nodes on the given rack - Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the sub-cluster of any node on the rack cannot be resolved, or if the rack name is not recognized
-