Class MappingRuleMatchers.VariableMatcher

java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.placement.csmappingrule.MappingRuleMatchers.VariableMatcher
All Implemented Interfaces:
MappingRuleMatcher
Enclosing class:
MappingRuleMatchers

public static class MappingRuleMatchers.VariableMatcher extends Object implements MappingRuleMatcher
VariableMatcher will check if a provided variable's value matches the provided value. The provided value might contain variables as well, which will get evaluated before the comparison.
  • Method Details

    • match

      public boolean match(VariableContext variables)
      The method will replace all variables in the value, then compares this substituted value against the variable's value, if they match we return true. If the variable is null we always return false.
      Specified by:
      match in interface MappingRuleMatcher
      Parameters:
      variables - The variable context, which contains all the variables
      Returns:
      true if the value matches the variable's value, false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object