Class DefaultPlacementRule


@Private @Unstable public class DefaultPlacementRule extends FSPlacementRule
Places apps in the specified default queue. If no default queue is specified the app is placed in root.default queue.
  • Field Details

    • defaultQueueName

      @VisibleForTesting public String defaultQueueName
  • Constructor Details

    • DefaultPlacementRule

      public DefaultPlacementRule()
  • Method Details

    • setConfig

      public void setConfig(Element conf)
      Set the rule config from the xml config.
      Overrides:
      setConfig in class FSPlacementRule
      Parameters:
      conf - An xml element from the FairScheduler.conf
    • setConfig

      public void setConfig(Boolean create)
      Set the rule config just setting the create flag.
      Overrides:
      setConfig in class FSPlacementRule
      Parameters:
      create - flag to allow queue creation for this rule
    • initialize

      public boolean initialize(ResourceScheduler scheduler) throws IOException
      Description copied from class: FSPlacementRule
      Standard initialisation for FairScheduler rules, shared by all rules. Each rule that extends this abstract and overrides this method must call super.initialize() to run this basic initialisation.
      Overrides:
      initialize in class FSPlacementRule
      Parameters:
      scheduler - the scheduler using the rule
      Returns:
      true in all cases
      Throws:
      IOException - for any errors
    • getPlacementForApp

      public ApplicationPlacementContext getPlacementForApp(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext asc, String user)
      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