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

@Private @Unstable public abstract class FSPlacementRule extends PlacementRule
Abstract base for all FairScheduler Placement Rules.
  • Field Details

    • createQueue

      @VisibleForTesting protected boolean createQueue
  • Constructor Details

    • FSPlacementRule

      public FSPlacementRule()
  • Method Details

    • setParentRule

      public void setParentRule(PlacementRule parent)
      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

      @VisibleForTesting public PlacementRule getParentRule()
      Get the rule that is set to generate the parent queue dynamically.
      Returns:
      The rule set or null if not set.
    • setConfig

      public void setConfig(Object initArg)
      Set the config based on the type of object passed in.
      Overrides:
      setConfig in class PlacementRule
      Parameters:
      initArg - the config to be set
    • setConfig

      protected void setConfig(Element conf)
      Set the rule config from the xml config.
      Parameters:
      conf - An xml element from the FairScheduler.conf
    • setConfig

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

      public boolean initialize(ResourceScheduler scheduler) throws IOException
      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.
      Specified by:
      initialize in class PlacementRule
      Parameters:
      scheduler - the scheduler using the rule
      Returns:
      true in 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 createQueue flag