Class MappingRuleValidationContextImpl
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.placement.csmappingrule.MappingRuleValidationContextImpl
- All Implemented Interfaces:
MappingRuleValidationContext
public class MappingRuleValidationContextImpl
extends Object
implements MappingRuleValidationContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddImmutableVariable(String variable) This method will add a known immutable variable to the validation context, known variables can be used to determine if a path is static or dynamic.voidaddVariable(String variable) This method will add a known variable to the validation context, known variables can be used to determine if a path is static or dynamic.This method will return all the known variables.booleanisPathStatic(String queuePath) Method to determine if the provided queue path contains any dynamic parts A part is dynamic if a known variable is referenced in it.booleanvalidateQueuePath(String queuePath) This method should determine if the provided queue path can result in a possible placement.
-
Constructor Details
-
MappingRuleValidationContextImpl
-
-
Method Details
-
validateQueuePath
public boolean validateQueuePath(String queuePath) throws org.apache.hadoop.yarn.exceptions.YarnException This method should determine if the provided queue path can result in a possible placement. It should fail if the provided path cannot be placed into any of the known queues regardless of the variable context.- Specified by:
validateQueuePathin interfaceMappingRuleValidationContext- Parameters:
queuePath- The path to check- Returns:
- true if the validation was successful
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the provided queue path is invalid
-
isPathStatic
public boolean isPathStatic(String queuePath) throws org.apache.hadoop.yarn.exceptions.YarnException Method to determine if the provided queue path contains any dynamic parts A part is dynamic if a known variable is referenced in it.- Specified by:
isPathStaticin interfaceMappingRuleValidationContext- Parameters:
queuePath- The path to check- Returns:
- true if no dynamic parts were found
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if a path part is invalid (eg. empty)
-
addVariable
This method will add a known variable to the validation context, known variables can be used to determine if a path is static or dynamic.- Specified by:
addVariablein interfaceMappingRuleValidationContext- Parameters:
variable- Name of the variable- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- If the variable to be added has already added as an immutable one, an exception is thrown
-
addImmutableVariable
public void addImmutableVariable(String variable) throws org.apache.hadoop.yarn.exceptions.YarnException This method will add a known immutable variable to the validation context, known variables can be used to determine if a path is static or dynamic.- Specified by:
addImmutableVariablein interfaceMappingRuleValidationContext- Parameters:
variable- Name of the immutable variable- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- If the variable to be added has already added as a regular, mutable variable an exception is thrown
-
getVariables
This method will return all the known variables.- Specified by:
getVariablesin interfaceMappingRuleValidationContext- Returns:
- Set of the known variables
-