Class MappingRuleActionBase
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.placement.csmappingrule.MappingRuleActionBase
- All Implemented Interfaces:
MappingRuleAction
- Direct Known Subclasses:
MappingRuleActions.PlaceToQueueAction,MappingRuleActions.RejectAction,MappingRuleActions.VariableUpdateAction
This class implements the fallback logic for MappingRuleActions, this can
be extended to implement the actual logic of the actions, this should be
a base class for most actions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract MappingRuleResultexecute(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.Returns the fallback action to be taken if the main action (result returned by the execute method) fails.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.Sets the fallback method to reject, if the action cannot be executed the application will get rejected.Sets the fallback method to skip, if the action cannot be executed We move onto the next rule, ignoring this one.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.yarn.server.resourcemanager.placement.csmappingrule.MappingRuleAction
validate
-
Constructor Details
-
MappingRuleActionBase
public MappingRuleActionBase()
-
-
Method Details
-
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- Specified by:
getFallbackin interfaceMappingRuleAction- Returns:
- The fallback action to be taken if the main action fails
-
setFallbackReject
Sets the fallback method to reject, if the action cannot be executed the application will get rejected.- Specified by:
setFallbackRejectin interfaceMappingRuleAction- Returns:
- MappingRuleAction The same object for method chaining.
-
setFallbackSkip
Sets the fallback method to skip, if the action cannot be executed We move onto the next rule, ignoring this one.- Specified by:
setFallbackSkipin interfaceMappingRuleAction- Returns:
- MappingRuleAction The same object for method chaining.
-
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.- Specified by:
setFallbackDefaultPlacementin interfaceMappingRuleAction- Returns:
- MappingRuleAction The same object for method chaining.
-
execute
This method is the main logic of the action, it shall determine based on the mapping context, what should be the action's result.- Specified by:
executein interfaceMappingRuleAction- Parameters:
variables- The variable context, which contains all the variables- Returns:
- The result of the action
-