Class MappingRuleConditionalVariables.SecondaryGroupVariable

java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.placement.csmappingrule.MappingRuleConditionalVariables.SecondaryGroupVariable
All Implemented Interfaces:
MappingRuleConditionalVariable
Enclosing class:
MappingRuleConditionalVariables

public static class MappingRuleConditionalVariables.SecondaryGroupVariable extends Object implements MappingRuleConditionalVariable
SecondaryGroupVariable represents a conditional variable which is supposed to evaluate path parts with "%secondary_group". The evaluation depends on if parent path is provided. If there was no parent path provided, the %secondary_group variable will be equal to the first non-primary group of the user which has a matching queue in the queue hierarchy. This means the queue name must be disambiguous as well. If there is a parent provided (the %secondary_group variable is not the first element in the path), the %secondary_group variable will be equal to the first non-primary group of the user which has a matching queue UNDER the parent path. The parent path must be a full path, to avoid ambiguity problems.
  • Field Details

    • VARIABLE_NAME

      public static final String VARIABLE_NAME
      This is the name of the variable we are replacing.
      See Also:
  • Constructor Details

    • SecondaryGroupVariable

      public SecondaryGroupVariable(CapacitySchedulerQueueManager qm, List<String> groups)
      Constructor requires a queue manager instance and a list of potential secondary groups.
      Parameters:
      qm - The queue manager which will be used to check which potential secondary group should be used.
      groups - List of potential secondary groups.
  • Method Details

    • evaluateInPath

      public String evaluateInPath(String[] parts, int currentIndex)
      Method used to evaluate the variable when used in a path.
      Specified by:
      evaluateInPath in interface MappingRuleConditionalVariable
      Parameters:
      parts - Split representation of the path.
      currentIndex - The index of the evaluation in the path. This shows which part is currently being evaluated.
      Returns:
      Substituted queue path part, this method will only return the value of the conditional variable, not the whole path.
    • toString

      public String toString()
      Overrides:
      toString in class Object