Class CSMappingPlacementRule

java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.placement.PlacementRule
org.apache.hadoop.yarn.server.resourcemanager.placement.CSMappingPlacementRule

public class CSMappingPlacementRule extends PlacementRule
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 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

      public boolean initialize(ResourceScheduler scheduler) throws IOException
      Description copied from class: PlacementRule
      Initialize the rule with the scheduler.
      Specified by:
      initialize in class PlacementRule
      Parameters:
      scheduler - the scheduler using the rule
      Returns:
      true or false The 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: PlacementRule
      Return the scheduler queue name the application should be placed in wrapped in an ApplicationPlacementContext object. A non null return value places the application in a queue, a null value means the queue is not yet determined. The next PlacementRule in the list maintained in the PlacementManager will be executed.
      Specified by:
      getPlacementForApp in class PlacementRule
      Parameters:
      asc - The context of the application created on submission
      user - The name of the user submitting the application
      Returns:
      The queue name wrapped in ApplicationPlacementContext or null if 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: PlacementRule
      Return the scheduler queue name the application should be placed in wrapped in an ApplicationPlacementContext object. A non null return value places the application in a queue, a null value means the queue is not yet determined. The next PlacementRule in the list maintained in the PlacementManager will be executed.
      Overrides:
      getPlacementForApp in class PlacementRule
      Parameters:
      asc - The context of the application created on submission
      user - The name of the user submitting the application
      recovery - Indicates if the submission is a recovery
      Returns:
      The queue name wrapped in ApplicationPlacementContext or null if 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()