Class WeightedRandomRouterPolicy

All Implemented Interfaces:
ConfigurableFederationPolicy, FederationRouterPolicy
Direct Known Subclasses:
LocalityRouterPolicy

public class WeightedRandomRouterPolicy extends AbstractRouterPolicy
This policy implements a weighted random sample among currently active sub-clusters.
  • Constructor Details

    • WeightedRandomRouterPolicy

      public WeightedRandomRouterPolicy()
  • Method Details

    • chooseSubCluster

      protected SubClusterId chooseSubCluster(String queue, Map<SubClusterId,SubClusterInfo> preSelectSubclusters) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from class: AbstractRouterPolicy
      This method is implemented by the specific policy, and it is used to route both reservations, and applications among a given set of sub-clusters.
      Specified by:
      chooseSubCluster in class AbstractRouterPolicy
      Parameters:
      queue - the queue for this application/reservation
      preSelectSubclusters - a pre-filter set of sub-clusters
      Returns:
      the chosen sub-cluster
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the policy fails to choose a sub-cluster