Class QueueManager
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.QueueManager
Maintains a list of queues as well as scheduling parameters for each queue,
such as guaranteed share allocations, from the fair scheduler config file.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn whether a queue exists already.getLeafQueue(String name, boolean create) Get a leaf queue by name, creating it if the create param istrueand the queue does not exist.getLeafQueue(String name, boolean create, org.apache.hadoop.yarn.api.records.ApplicationId applicationId) Get a leaf queue by name, creating it if the create param istrueand the queue does not exist.Get a collection of all leaf queues.getParentQueue(String name, boolean create) Get a parent queue by name, creating it if the create param istrueand the queue does not exist.getParentQueue(String name, boolean create, boolean recomputeSteadyShares) Get a parent queue by name, creating it if the create param istrueand the queue does not exist.Gets a queue by name.Get a collection of all queues.voidvoidRemoves all empty dynamic queues (including empty dynamic parent queues).booleanremoveLeafQueue(String name) Remove a leaf queue if empty.voidRe-checking incompatible queues that could not be removed earlier due to not being empty, and removing those that became empty.protected voidsetQueuesToDynamic(Set<String> queueNames) Setting a set of queues to dynamic.void
-
Field Details
-
ROOT_QUEUE
- See Also:
-
-
Constructor Details
-
QueueManager
-
-
Method Details
-
getRootQueue
-
initialize
public void initialize() -
getLeafQueue
Get a leaf queue by name, creating it if the create param istrueand the queue does not exist. If the queue is not or can not be a leaf queue, i.e. it already exists as a parent queue, or one of the parents in its name is already a leaf queue,nullis returned. The root part of the name is optional, so a queue underneath the root named "queue1" could be referred to as just "queue1", and a queue named "queue2" underneath a parent named "parent1" that is underneath the root could be referred to as just "parent1.queue2".- Parameters:
name- name of the queuecreate-trueif the queue must be created if it does not exist,falseotherwise- Returns:
- the leaf queue or
nullif the queue cannot be found
-
getLeafQueue
public FSLeafQueue getLeafQueue(String name, boolean create, org.apache.hadoop.yarn.api.records.ApplicationId applicationId) Get a leaf queue by name, creating it if the create param istrueand the queue does not exist. If the queue is not or can not be a leaf queue, i.e. it already exists as a parent queue, or one of the parents in its name is already a leaf queue,nullis returned. If the application will be assigned to the queue if the applicationId is notnull- Parameters:
name- name of the queuecreate-trueif the queue must be created if it does not exist,falseotherwiseapplicationId- the application ID to assign to the queue- Returns:
- the leaf queue or
nullif teh queue cannot be found
-
removeLeafQueue
Remove a leaf queue if empty.- Parameters:
name- name of the queue- Returns:
- true if queue was removed or false otherwise
-
getParentQueue
Get a parent queue by name, creating it if the create param istrueand the queue does not exist. If the queue is not or can not be a parent queue, i.e. it already exists as a leaf queue, or one of the parents in its name is already a leaf queue,nullis returned. The root part of the name is optional, so a queue underneath the root named "queue1" could be referred to as just "queue1", and a queue named "queue2" underneath a parent named "parent1" that is underneath the root could be referred to as just "parent1.queue2".- Parameters:
name- name of the queuecreate-trueif the queue must be created if it does not exist,falseotherwise- Returns:
- the parent queue or
nullif the queue cannot be found
-
getParentQueue
Get a parent queue by name, creating it if the create param istrueand the queue does not exist. If the queue is not or can not be a parent queue, i.e. it already exists as a leaf queue, or one of the parents in its name is already a leaf queue,nullis returned. The root part of the name is optional, so a queue underneath the root named "queue1" could be referred to as just "queue1", and a queue named "queue2" underneath a parent named "parent1" that is underneath the root could be referred to as just "parent1.queue2".- Parameters:
name- name of the queuecreate-trueif the queue must be created if it does not exist,falseotherwiserecomputeSteadyShares-trueif the steady fair share should be recalculated when a queue is added,falseotherwise- Returns:
- the parent queue or
nullif the queue cannot be found
-
removeEmptyDynamicQueues
public void removeEmptyDynamicQueues()Removes all empty dynamic queues (including empty dynamic parent queues). -
removePendingIncompatibleQueues
public void removePendingIncompatibleQueues()Re-checking incompatible queues that could not be removed earlier due to not being empty, and removing those that became empty. -
getQueue
Gets a queue by name.- Parameters:
name- queue name.- Returns:
- queue objects, FSQueue.
-
exists
Return whether a queue exists already.- Parameters:
name- queue name.- Returns:
- Returns true if the queue exists, otherwise returns false.
-
getLeafQueues
Get a collection of all leaf queues.- Returns:
- a collection of all leaf queues.
-
getQueues
Get a collection of all queues.- Returns:
- a collection of all queues.
-
updateAllocationConfiguration
-
setQueuesToDynamic
Setting a set of queues to dynamic.- Parameters:
queueNames- The names of the queues to be set to dynamic
-