Class MappingRuleActions.PlaceToQueueAction

java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.placement.csmappingrule.MappingRuleActionBase
org.apache.hadoop.yarn.server.resourcemanager.placement.csmappingrule.MappingRuleActions.PlaceToQueueAction
All Implemented Interfaces:
MappingRuleAction
Enclosing class:
MappingRuleActions

public static class MappingRuleActions.PlaceToQueueAction extends MappingRuleActionBase
PlaceToQueueAction represents a placement action, contains the pattern of the queue name or path in which the path variables will be substituted with the variable context's respective values.
  • Method Details

    • execute

      public MappingRuleResult execute(VariableContext variables)
      This method is the main logic of the action, it will replace all the variables in the queuePattern with their respective values, then returns a placementResult with the final queue name.
      Specified by:
      execute in interface MappingRuleAction
      Specified by:
      execute in class MappingRuleActionBase
      Parameters:
      variables - The variable context, which contains all the variables
      Returns:
      The result of the action
    • validate

      public void validate(MappingRuleValidationContext ctx) throws org.apache.hadoop.yarn.exceptions.YarnException
      This method is responsible for config validation, we use the validation context's helper method to validate if our path is valid. From the point of the action all paths are valid, that is why we need to use an external component which is aware of the queue structure and know when a queue placement is valid in that context. This way this calass can stay independent of the capacity scheduler's internal queue placement logic, yet it is able to obey it's rules.
      Parameters:
      ctx - Validation context with all the necessary objects and helper methods required during validation
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - is thrown on validation error
    • toString

      public String toString()
      Overrides:
      toString in class Object