Class CapacitySchedulerQueueManager
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerQueueManager
- All Implemented Interfaces:
SchedulerQueueManager<CSQueue,CapacitySchedulerConfiguration>
@Private
@Unstable
public class CapacitySchedulerQueueManager
extends Object
implements SchedulerQueueManager<CSQueue,CapacitySchedulerConfiguration>
Context of the Queues in Capacity Scheduler.
-
Constructor Summary
ConstructorsConstructorDescriptionCapacitySchedulerQueueManager(org.apache.hadoop.conf.Configuration conf, RMNodeLabelsManager labelManager, AppPriorityACLsManager appPriorityACLManager) Construct the service. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLegacyDynamicQueue(Queue queue) Adds anAutoCreatedLeafQueueto the manager collection and extends the children collection of its parent.voidAdd a new queue to the existing queues.createQueue(QueuePath queue) Auto creates a LeafQueue and its upper hierarchy given a path at runtime.determineMissingParents(QueuePath queue) Determines the missing parent paths of a potentially auto creatable queue.getAndCheckLeafQueue(String queue) Check that the String provided in input is the name of an existing, LeafQueue, if successful returns the queue.GetConfiguredNodeLabelswhich contains the configured node labels for all queues.org.apache.hadoop.yarn.api.records.PrioritygetDefaultPriorityForQueue(String queueName) Get the default priority of the queue.List<org.apache.hadoop.yarn.security.Permission>getPermissionsForDynamicQueue(QueuePath queuePath, CapacitySchedulerConfiguration csConf) Get a queue matching the specified queue name.getQueueByFullName(String name) Get all the queues.Get the root queue.voidInitialized the queues.booleanisAmbiguous(String shortName) voidvoidReinitialize the queues.voidremoveLegacyDynamicQueue(String queueName) Removes anAutoCreatedLeafQueuefrom the manager collection and from its parent children collection.voidremoveQueue(String queueName) Remove the queue from the existing queue.voidsetCapacitySchedulerContext(CapacitySchedulerContext capacitySchedulerContext) Set the CapacitySchedulerContext.static voidsetQueueAcls(org.apache.hadoop.yarn.security.YarnAuthorizationProvider authorizer, AppPriorityACLsManager appPriorityACLManager, CSQueueStore queues) protected voidsetRootQueue(CSQueue rootQueue)
-
Constructor Details
-
CapacitySchedulerQueueManager
public CapacitySchedulerQueueManager(org.apache.hadoop.conf.Configuration conf, RMNodeLabelsManager labelManager, AppPriorityACLsManager appPriorityACLManager) Construct the service.- Parameters:
conf- the configurationlabelManager- the labelManagerappPriorityACLManager- App priority ACL manager
-
-
Method Details
-
getRootQueue
Description copied from interface:SchedulerQueueManagerGet the root queue.- Specified by:
getRootQueuein interfaceSchedulerQueueManager<CSQueue,CapacitySchedulerConfiguration> - Returns:
- root queue
-
setRootQueue
-
getQueues
Description copied from interface:SchedulerQueueManagerGet all the queues.- Specified by:
getQueuesin interfaceSchedulerQueueManager<CSQueue,CapacitySchedulerConfiguration> - Returns:
- a map contains all the queues as well as related queue names
-
getShortNameQueues
-
removeQueue
Description copied from interface:SchedulerQueueManagerRemove the queue from the existing queue.- Specified by:
removeQueuein interfaceSchedulerQueueManager<CSQueue,CapacitySchedulerConfiguration> - Parameters:
queueName- the queue name
-
addQueue
Description copied from interface:SchedulerQueueManagerAdd a new queue to the existing queues.- Specified by:
addQueuein interfaceSchedulerQueueManager<CSQueue,CapacitySchedulerConfiguration> - Parameters:
queueName- the queue namequeue- the queue object
-
getQueue
Description copied from interface:SchedulerQueueManagerGet a queue matching the specified queue name.- Specified by:
getQueuein interfaceSchedulerQueueManager<CSQueue,CapacitySchedulerConfiguration> - Parameters:
queueName- the queue name- Returns:
- a queue object
-
getQueueByFullName
-
isAmbiguous
-
setCapacitySchedulerContext
Set the CapacitySchedulerContext.- Parameters:
capacitySchedulerContext- the CapacitySchedulerContext
-
initializeQueues
Initialized the queues.- Parameters:
conf- the CapacitySchedulerConfiguration- Throws:
IOException- if fails to initialize queues
-
reinitializeQueues
Description copied from interface:SchedulerQueueManagerReinitialize the queues.- Specified by:
reinitializeQueuesin interfaceSchedulerQueueManager<CSQueue,CapacitySchedulerConfiguration> - Parameters:
newConf- the configuration- Throws:
IOException- if fails to re-initialize queues
-
setQueueAcls
@VisibleForTesting public static void setQueueAcls(org.apache.hadoop.yarn.security.YarnAuthorizationProvider authorizer, AppPriorityACLsManager appPriorityACLManager, CSQueueStore queues) throws IOException - Throws:
IOException
-
getAndCheckLeafQueue
public AbstractLeafQueue getAndCheckLeafQueue(String queue) throws org.apache.hadoop.yarn.exceptions.YarnException Check that the String provided in input is the name of an existing, LeafQueue, if successful returns the queue.- Parameters:
queue- the queue name- Returns:
- the LeafQueue
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the queue does not exist or the queue is not the type of LeafQueue.
-
getDefaultPriorityForQueue
Get the default priority of the queue.- Parameters:
queueName- the queue name- Returns:
- the default priority of the queue
-
getQueueStateManager
-
getQueueCapacityHandler
-
removeLegacyDynamicQueue
Removes anAutoCreatedLeafQueuefrom the manager collection and from its parent children collection.- Parameters:
queueName- queue to be removed- Throws:
SchedulerDynamicEditException- if queue is not eligible for deletion
-
addLegacyDynamicQueue
Adds anAutoCreatedLeafQueueto the manager collection and extends the children collection of its parent.- Parameters:
queue- to be added- Throws:
SchedulerDynamicEditException- if queue is not eligible to be addedIOException- if parent can not accept the queue
-
createQueue
public AbstractLeafQueue createQueue(QueuePath queue) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException Auto creates a LeafQueue and its upper hierarchy given a path at runtime.- Parameters:
queue- the application placement information of the queue- Returns:
- the auto created LeafQueue
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the given path is not eligible to be auto createdIOException- if the given path can not be added to the parent
-
determineMissingParents
Determines the missing parent paths of a potentially auto creatable queue. The missing parents are sorted in a way that the first item is the highest in the hierarchy. Example: root.a, root.a.b, root.a.b.c- Parameters:
queue- to be auto created- Returns:
- missing parent paths
- Throws:
SchedulerDynamicEditException- if the given queue is not eligible to be auto created
-
getPermissionsForDynamicQueue
public List<org.apache.hadoop.yarn.security.Permission> getPermissionsForDynamicQueue(QueuePath queuePath, CapacitySchedulerConfiguration csConf) -
getConfiguredNodeLabelsForAllQueues
GetConfiguredNodeLabelswhich contains the configured node labels for all queues.- Returns:
- configured node labels
-
reinitConfiguredNodeLabels
-