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 Details

  • 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:
      validateQueuePath in interface MappingRuleValidationContext
      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:
      isPathStatic in interface MappingRuleValidationContext
      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

      public void addVariable(String variable) throws org.apache.hadoop.yarn.exceptions.YarnException
      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:
      addVariable in interface MappingRuleValidationContext
      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:
      addImmutableVariable in interface MappingRuleValidationContext
      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

      public Set<String> getVariables()
      This method will return all the known variables.
      Specified by:
      getVariables in interface MappingRuleValidationContext
      Returns:
      Set of the known variables