Class QueuePath
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueuePath
This is a helper class which represents a queue path, and has easy access
methods to get the path's parent or leaf part, or as a whole.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic QueuePathcreateFromQueues(String... parts) Constructor to create Queue path from queue names.createNewLeaf(String childQueue) Creates a newQueuePathfrom the current full path as parent, and the appended child queue path as leaf.booleanGetter for the full path of the queue.Getter for the leaf part of the path.Getter for the parent part of the path.Getter for the parent object of the path.String[]Returns queue path components.getWildcardedQueuePaths(int maxAutoCreatedQueueDepth) Returns the list of wildcarded queue paths based on the autoCreatedQueueDepth config value.booleanSimple helper method to determine if the path contains any empty parts.inthashCode()booleanConvenience getter to check if the queue has a parent path defined.booleanSimple helper method to determine if the queue path is invalid or not.booleanisRoot()Convenience getter to check if the queue is the root queue.iterator()Returns an iterator of queue path parts, starting from the highest level (generally root).Returns an iterator that provides a way to traverse the queue path from current queue through its parents.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
QueuePath
Constructor to create mapping queue path from parent path and leaf name.- Parameters:
parent- Parent path of the queueleaf- Name of the leaf queue
-
QueuePath
Constructor creates a MappingQueuePath object using the queue's full path.- Parameters:
fullPath- Full path of the queue
-
-
Method Details
-
createFromQueues
Constructor to create Queue path from queue names. The provided queue names will be concatenated by dots, giving a full queue path.- Parameters:
parts- Parts of queue path- Returns:
- QueuePath object
-
hasEmptyPart
public boolean hasEmptyPart()Simple helper method to determine if the path contains any empty parts.- Returns:
- true if there is at least one empty part of the path
-
isInvalid
public boolean isInvalid()Simple helper method to determine if the queue path is invalid or not.- Returns:
- true if the queue path is invalid.
-
getParent
Getter for the parent part of the path.- Returns:
- Parent path of the queue, null if there is no parent.
-
getParentObject
Getter for the parent object of the path.- Returns:
- Parent QueuePath object of the queue, null if there is no parent.
-
getLeafName
Getter for the leaf part of the path.- Returns:
- The leaf queue name
-
getFullPath
Getter for the full path of the queue.- Returns:
- Full path of the queue
-
hasParent
public boolean hasParent()Convenience getter to check if the queue has a parent path defined.- Returns:
- True if there is a parent path provided
-
isRoot
public boolean isRoot()Convenience getter to check if the queue is the root queue.- Returns:
- True if the path is root
-
createNewLeaf
Creates a newQueuePathfrom the current full path as parent, and the appended child queue path as leaf.- Parameters:
childQueue- path of leaf queue- Returns:
- new queue path made of current full path and appended leaf path
-
iterator
Returns an iterator of queue path parts, starting from the highest level (generally root). -
reverseIterator
Returns an iterator that provides a way to traverse the queue path from current queue through its parents.- Returns:
- queue path iterator
-
getWildcardedQueuePaths
Returns the list of wildcarded queue paths based on the autoCreatedQueueDepth config value. An example template precedence hierarchy for root.a ParentQueue from highest to lowest: yarn.scheduler.capacity.root.a.auto-queue-creation-v2.template.capacity yarn.scheduler.capacity.root.*.auto-queue-creation-v2.template.capacity- Parameters:
maxAutoCreatedQueueDepth- the maximum depth of auto-created queues stored in the configuration- Returns:
- list of wildcarded QueuePath objects
-
getPathComponents
Returns queue path components.- Returns:
- String array containing the queue names.
-
toString
-
equals
-
hashCode
public int hashCode()
-