Class PlacementFactory
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.placement.PlacementFactory
Factory class for creating instances of
PlacementRule.-
Method Summary
Modifier and TypeMethodDescriptionstatic PlacementRulegetPlacementRule(Class<? extends PlacementRule> ruleClass, Object initArg) Create a newPlacementRulebased on the rule class from the configuration.static PlacementRulegetPlacementRule(String ruleStr, org.apache.hadoop.conf.Configuration conf) Create a newPlacementRulebased on the rule class from the configuration.
-
Method Details
-
getPlacementRule
public static PlacementRule getPlacementRule(String ruleStr, org.apache.hadoop.conf.Configuration conf) throws ClassNotFoundException Create a newPlacementRulebased 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 instantiateconf- 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 newPlacementRulebased 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 instantiateinitArg- The config to set- Returns:
- Created class instance
-