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 Details

    • DefaultSubClusterResolverImpl

      public DefaultSubClusterResolverImpl()
  • Method Details

    • setConf

      public void setConf(org.apache.hadoop.conf.Configuration conf)
      Specified by:
      setConf in interface org.apache.hadoop.conf.Configurable
    • getConf

      public org.apache.hadoop.conf.Configuration getConf()
      Specified by:
      getConf in interface org.apache.hadoop.conf.Configurable
    • getSubClusterForNode

      public SubClusterId getSubClusterForNode(String nodename) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: SubClusterResolver
      Obtain the sub-cluster that a specified node belongs to.
      Specified by:
      getSubClusterForNode in interface SubClusterResolver
      Overrides:
      getSubClusterForNode in class AbstractSubClusterResolver
      Parameters:
      nodename - the node whose sub-cluster is to be determined
      Returns:
      the sub-cluster as identified by the SubClusterId that 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: SubClusterResolver
      Load the nodes to subCluster mapping from the file.
      Specified by:
      load in interface SubClusterResolver
    • getSubClustersForRack

      public Set<SubClusterId> getSubClustersForRack(String rackname) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: SubClusterResolver
      Obtain the sub-clusters that have nodes on a specified rack.
      Specified by:
      getSubClustersForRack in interface SubClusterResolver
      Overrides:
      getSubClustersForRack in class AbstractSubClusterResolver
      Parameters:
      rackname - the name of the rack
      Returns:
      the sub-clusters as identified by the SubClusterId that 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