Interface SubClusterResolver
- All Superinterfaces:
org.apache.hadoop.conf.Configurable
- All Known Implementing Classes:
AbstractSubClusterResolver,DefaultSubClusterResolverImpl
public interface SubClusterResolver
extends org.apache.hadoop.conf.Configurable
An utility that helps to determine the sub-cluster that a specified node or
rack belongs to. All implementing classes should be thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptiongetSubClusterForNode(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.Methods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
-
Method Details
-
getSubClusterForNode
SubClusterId getSubClusterForNode(String nodename) throws org.apache.hadoop.yarn.exceptions.YarnException Obtain the sub-cluster that a specified node belongs to.- 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
-
getSubClustersForRack
Set<SubClusterId> getSubClustersForRack(String rackname) throws org.apache.hadoop.yarn.exceptions.YarnException Obtain the sub-clusters that have nodes on a specified rack.- 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
-
load
void load()Load the nodes to subCluster mapping from the file.
-