Class CSMappingPlacementRule
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.placement.PlacementRule
org.apache.hadoop.yarn.server.resourcemanager.placement.CSMappingPlacementRule
This class is responsible for making application submissions to queue
assignments, based on the configured ruleset. This class supports all
features supported by UserGroupMappingPlacementRule and
AppNameMappingPlacementRule classes, also adding some features which are
present in fair scheduler queue placement. This helps to reduce the gap
between the two schedulers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.security.GroupsgetPlacementForApp(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext asc, String user) Return the scheduler queue name the application should be placed in wrapped in anApplicationPlacementContextobject.getPlacementForApp(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext asc, String user, boolean recovery) Return the scheduler queue name the application should be placed in wrapped in anApplicationPlacementContextobject.booleaninitialize(ResourceScheduler scheduler) Initialize the rule with the scheduler.voidsetFailOnConfigError(boolean failOnConfigError) voidsetGroups(org.apache.hadoop.security.Groups groups) Methods inherited from class org.apache.hadoop.yarn.server.resourcemanager.placement.PlacementRule
getName, setConfig
-
Constructor Details
-
CSMappingPlacementRule
public CSMappingPlacementRule()
-
-
Method Details
-
setGroups
@VisibleForTesting public void setGroups(org.apache.hadoop.security.Groups groups) -
setFailOnConfigError
@VisibleForTesting public void setFailOnConfigError(boolean failOnConfigError) -
initialize
Description copied from class:PlacementRuleInitialize the rule with the scheduler.- Specified by:
initializein classPlacementRule- Parameters:
scheduler- the scheduler using the rule- Returns:
trueorfalseThe outcome of the initialisation, rule dependent response which might not be persisted in the rule.- Throws:
IOException- for any errors
-
getPlacementForApp
public ApplicationPlacementContext getPlacementForApp(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext asc, String user) throws org.apache.hadoop.yarn.exceptions.YarnException Description copied from class:PlacementRuleReturn the scheduler queue name the application should be placed in wrapped in anApplicationPlacementContextobject. A nonnullreturn value places the application in a queue, anullvalue means the queue is not yet determined. The nextPlacementRulein the list maintained in thePlacementManagerwill be executed.- Specified by:
getPlacementForAppin classPlacementRule- Parameters:
asc- The context of the application created on submissionuser- The name of the user submitting the application- Returns:
- The queue name wrapped in
ApplicationPlacementContextornullif no queue was resolved - Throws:
org.apache.hadoop.yarn.exceptions.YarnException- for any error while executing the rule
-
getPlacementForApp
public ApplicationPlacementContext getPlacementForApp(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext asc, String user, boolean recovery) throws org.apache.hadoop.yarn.exceptions.YarnException Description copied from class:PlacementRuleReturn the scheduler queue name the application should be placed in wrapped in anApplicationPlacementContextobject. A nonnullreturn value places the application in a queue, anullvalue means the queue is not yet determined. The nextPlacementRulein the list maintained in thePlacementManagerwill be executed.- Overrides:
getPlacementForAppin classPlacementRule- Parameters:
asc- The context of the application created on submissionuser- The name of the user submitting the applicationrecovery- Indicates if the submission is a recovery- Returns:
- The queue name wrapped in
ApplicationPlacementContextornullif no queue was resolved - Throws:
org.apache.hadoop.yarn.exceptions.YarnException- for any error while executing the rule
-
getGroups
@VisibleForTesting public org.apache.hadoop.security.Groups getGroups()
-