Class MappingRuleActions.VariableUpdateAction
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.placement.csmappingrule.MappingRuleActionBase
org.apache.hadoop.yarn.server.resourcemanager.placement.csmappingrule.MappingRuleActions.VariableUpdateAction
- All Implemented Interfaces:
MappingRuleAction
- Enclosing class:
- MappingRuleActions
VariableUpdateAction represents the action which alters one of the
mutable variables in the variable context, but doesn't do anything with
the application. This can be used to change the default queue or define
custom variables to be used later.
-
Method Summary
Modifier and TypeMethodDescriptionexecute(VariableContext variables) This execute is a bit special, compared to other actions, since it does not affect the placement of the application, but changes the variable context.toString()voidDuring the validation process we add the variable set by this action to the known variables, to make sure the context is aware that we might introduce a new custom variable.Methods inherited from class org.apache.hadoop.yarn.server.resourcemanager.placement.csmappingrule.MappingRuleActionBase
getFallback, setFallbackDefaultPlacement, setFallbackReject, setFallbackSkip
-
Method Details
-
execute
This execute is a bit special, compared to other actions, since it does not affect the placement of the application, but changes the variable context. So it always returns a skip result in order to ensure the rule evalutaion continues after the variable update. The exectute method will do the update to the variable context the variable name stored in variableName will be updated with the value stored in variableValue, but all variables in the variableValue will gets resolved first, so this way dynamic updates are possible.- Specified by:
executein interfaceMappingRuleAction- Specified by:
executein classMappingRuleActionBase- Parameters:
variables- The variable context, which contains all the variables- Returns:
- Always a skip result.
-
validate
public void validate(MappingRuleValidationContext ctx) throws org.apache.hadoop.yarn.exceptions.YarnException During the validation process we add the variable set by this action to the known variables, to make sure the context is aware that we might introduce a new custom variable. All rules after this may use this variable. If the variable cannot be added (eg. it is already added as immutable), an exception will be thrown, and the validation will fail.- Parameters:
ctx- Validation context with all the necessary objects and helper methods required during validation- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- If the variable cannot be added to the context
-
toString
-