All Known Implementing Classes:
MappingRuleActionBase, MappingRuleActions.PlaceToQueueAction, MappingRuleActions.RejectAction, MappingRuleActions.VariableUpdateAction

public interface MappingRuleAction
This interface represents the action part of a MappingRule, action are responsible to decide what should happen with the actual application submission.
  • Method Details

    • getFallback

      MappingRuleResult getFallback()
      Returns the fallback action to be taken if the main action (result returned by the execute method) fails. e.g. Target queue does not exist, or reference is ambiguous
      Returns:
      The fallback action to be taken if the main action fails
    • execute

      MappingRuleResult execute(VariableContext variables)
      This method is the main logic of the action, it shall determine based on the mapping context, what should be the action's result.
      Parameters:
      variables - The variable context, which contains all the variables
      Returns:
      The result of the action
    • setFallbackReject

      MappingRuleAction setFallbackReject()
      Sets the fallback method to reject, if the action cannot be executed the application will get rejected.
      Returns:
      MappingRuleAction The same object for method chaining.
    • setFallbackSkip

      MappingRuleAction setFallbackSkip()
      Sets the fallback method to skip, if the action cannot be executed We move onto the next rule, ignoring this one.
      Returns:
      MappingRuleAction The same object for method chaining.
    • setFallbackDefaultPlacement

      MappingRuleAction setFallbackDefaultPlacement()
      Sets the fallback method to place to default, if the action cannot be executed. The application will be placed into the default queue, if the default queue does not exist the application will get rejected
      Returns:
      MappingRuleAction The same object for method chaining.
    • validate

      void validate(MappingRuleValidationContext ctx) throws org.apache.hadoop.yarn.exceptions.YarnException
      This method is responsible for config validation, the context contains all information required for validation, method should throw an exception on detectable setup errors.
      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