Class FSPlacementRule
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.placement.PlacementRule
org.apache.hadoop.yarn.server.resourcemanager.placement.FSPlacementRule
- Direct Known Subclasses:
DefaultPlacementRule,PrimaryGroupPlacementRule,RejectPlacementRule,SecondaryGroupExistingPlacementRule,SpecifiedPlacementRule,UserPlacementRule
Abstract base for all
FairScheduler Placement Rules.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet the create flag as set during the config setup.Get the rule that is set to generate the parent queue dynamically.booleaninitialize(ResourceScheduler scheduler) Standard initialisation forFairSchedulerrules, shared by all rules.protected voidSet the rule config just setting the create flag.voidSet the config based on the type of object passed in.protected voidSet the rule config from the xml config.voidsetParentRule(PlacementRule parent) Set a rule to generate the parent queue dynamically.Methods inherited from class org.apache.hadoop.yarn.server.resourcemanager.placement.PlacementRule
getName, getPlacementForApp, getPlacementForApp
-
Field Details
-
createQueue
@VisibleForTesting protected boolean createQueue
-
-
Constructor Details
-
FSPlacementRule
public FSPlacementRule()
-
-
Method Details
-
setParentRule
Set a rule to generate the parent queue dynamically. The parent rule should only be called on rule creation when the policy is read from the configuration.- Parameters:
parent- A PlacementRule
-
getParentRule
Get the rule that is set to generate the parent queue dynamically.- Returns:
- The rule set or
nullif not set.
-
setConfig
Set the config based on the type of object passed in.- Overrides:
setConfigin classPlacementRule- Parameters:
initArg- the config to be set
-
setConfig
Set the rule config from the xml config.- Parameters:
conf- An xml element from theFairScheduler.conf
-
setConfig
Set the rule config just setting the create flag.- Parameters:
create- flag to allow queue creation for this rule
-
initialize
Standard initialisation forFairSchedulerrules, shared by all rules. Each rule that extends this abstract and overrides this method must callsuper.initialize()to run this basic initialisation.- Specified by:
initializein classPlacementRule- Parameters:
scheduler- the scheduler using the rule- Returns:
truein all cases- Throws:
IOException- for any errors
-
getCreateFlag
public boolean getCreateFlag()Get the create flag as set during the config setup.- Returns:
- The value of the
createQueueflag
-