Class QueueCapacityConfigParser
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.conf.QueueCapacityConfigParser
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisCapacityVectorFormat(String configuredCapacity) Checks whether the given capacity string is in a capacity vector compatible format.Creates aQueueCapacityVectorparsed from the capacity configuration property set for a queue.
-
Field Details
-
FLOAT_DIGIT_REGEX
- See Also:
-
-
Constructor Details
-
QueueCapacityConfigParser
public QueueCapacityConfigParser()
-
-
Method Details
-
parse
Creates aQueueCapacityVectorparsed from the capacity configuration property set for a queue.- Parameters:
capacityString- capacity string to parsequeuePath- queue for which the capacity property is parsed- Returns:
- a parsed capacity vector
-
isCapacityVectorFormat
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
-