java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.conf.QueueCapacityConfigParser

public class QueueCapacityConfigParser extends Object
A class that parses QueueCapacityVector from the capacity configuration property set for a queue. A new syntax for capacity property could be implemented, by creating a parser with a regex to match the pattern and a method that creates a QueueCapacityVector from the matched pattern. Extending the parsers field with a Parser object in the constructor is needed in this case. A new capacity type for the existing parsers could be added by extending the QueueCapacityVector.QueueCapacityType with a new type and its associated postfix symbol.
  • Field Details

  • Constructor Details

    • QueueCapacityConfigParser

      public QueueCapacityConfigParser()
  • Method Details

    • parse

      public QueueCapacityVector parse(String capacityString, QueuePath queuePath)
      Creates a QueueCapacityVector parsed from the capacity configuration property set for a queue.
      Parameters:
      capacityString - capacity string to parse
      queuePath - queue for which the capacity property is parsed
      Returns:
      a parsed capacity vector
    • isCapacityVectorFormat

      public boolean isCapacityVectorFormat(String configuredCapacity)
      Checks whether the given capacity string is in a capacity vector compatible format.
      Parameters:
      configuredCapacity - capacity string
      Returns:
      true, if capacity string is in capacity vector format, false otherwise