java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.placement.PlacementFactory

@Private @Unstable public final class PlacementFactory extends Object
Factory class for creating instances of PlacementRule.
  • Method Details

    • getPlacementRule

      public static PlacementRule getPlacementRule(String ruleStr, org.apache.hadoop.conf.Configuration conf) throws ClassNotFoundException
      Create a new PlacementRule based on the rule class from the configuration. This is used to instantiate rules by the scheduler which does not resolve the class before this call.
      Parameters:
      ruleStr - The name of the class to instantiate
      conf - The configuration object to set for the rule
      Returns:
      Created class instance
      Throws:
      ClassNotFoundException - no definition for the class with the specified name could be found.
    • getPlacementRule

      public static PlacementRule getPlacementRule(Class<? extends PlacementRule> ruleClass, Object initArg)
      Create a new PlacementRule based on the rule class from the configuration. This is used to instantiate rules by the scheduler which resolve the class before this call.
      Parameters:
      ruleClass - The specific class reference to instantiate
      initArg - The config to set
      Returns:
      Created class instance