Class AbstractParentQueue
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.AbstractCSQueue
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.AbstractParentQueue
- All Implemented Interfaces:
CSQueue,Queue,SchedulerQueue<CSQueue>
- Direct Known Subclasses:
AbstractManagedParentQueue,ParentQueue
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.AbstractCSQueue
AbstractCSQueue.CapacityConfigType -
Field Summary
FieldsFields inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.AbstractCSQueue
activitiesManager, authorizer, capacityConfigType, configuredCapacityVectors, configuredMaxCapacityVectors, queueAllocationSettings, queueContext, queueEntity, queueNodeLabelsSettings, queuePath, readLock, writeLock -
Constructor Summary
ConstructorsConstructorDescriptionAbstractParentQueue(CapacitySchedulerQueueContext queueContext, String queueName, CSQueue parent, CSQueue old) AbstractParentQueue(CapacitySchedulerQueueContext queueContext, String queueName, CSQueue parent, CSQueue old, boolean isDynamic) -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(org.apache.hadoop.yarn.api.records.Resource cluster, ResourceCommitRequest<FiCaSchedulerApp, FiCaSchedulerNode> request) assignContainers(org.apache.hadoop.yarn.api.records.Resource clusterResource, CandidateNodeSet<FiCaSchedulerNode> candidates, ResourceLimits resourceLimits, SchedulingMode schedulingMode) Assign containers to applications in the queue or it's children (if any).voidattachContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource, FiCaSchedulerApp application, RMContainer rmContainer) Attach a container to this queuevoidcollectSchedulerApplications(Collection<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> apps) Adds all applications in the queue and its subqueues to the given collection.voidcompletedContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource, FiCaSchedulerApp application, FiCaSchedulerNode node, RMContainer rmContainer, org.apache.hadoop.yarn.api.records.ContainerStatus containerStatus, RMContainerEventType event, CSQueue completedChildQueue, boolean sortQueues) A container assigned to the queue has completed.createNewQueue(String childQueuePath, boolean isLeaf) voiddetachContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource, FiCaSchedulerApp application, RMContainer rmContainer) Detach a container from this queuevoidfinishApplication(org.apache.hadoop.yarn.api.records.ApplicationId application, String user) An application submitted to this queue has finished.voidfinishApplicationAttempt(FiCaSchedulerApp application, String queue) An application attempt submitted to this queue has finished.Get theAbstractUsersManagerfor the queue.Get child queuesGet child queues By tryLock.intGet the number of applications in the queue.org.apache.hadoop.yarn.api.records.QueueInfogetQueueInfo(boolean includeChildQueues, boolean recursive) Get queue informationList<org.apache.hadoop.yarn.api.records.QueueUserACLInfo>getQueueUserAclInfo(org.apache.hadoop.security.UserGroupInformation user) Get queue ACLs for givenuser.getResourceLimitsOfChild(CSQueue child, org.apache.hadoop.yarn.api.records.Resource clusterResource, ResourceLimits parentLimits, String nodePartition, boolean netLimit) booleanbooleanChecks whether this queue is a dynamic queue and could be deleted.booleanCheck whether this queue supports adding additional child queues dynamically.booleanCheck whether this queue supports legacy(v1) dynamic child queue creation.voidrecoverContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource, SchedulerApplicationAttempt attempt, RMContainer rmContainer) Recover the state of the queue for a given container.voidrefreshAfterResourceCalculation(org.apache.hadoop.yarn.api.records.Resource clusterResource, ResourceLimits resourceLimits) voidreinitialize(CSQueue newlyParsedQueue, org.apache.hadoop.yarn.api.records.Resource clusterResource) Reinitialize the queue.voidremoveChildQueue(CSQueue queue) protected voidprotected voidsetupQueueConfigs(org.apache.hadoop.yarn.api.records.Resource clusterResource) Initialize queue properties that are based on configuration.voidStop the queue.voidsubmitApplication(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, String user, String queue) Submit a new application to the queue.voidsubmitApplicationAttempt(FiCaSchedulerApp application, String userName) Submit an application attempt to the queue.voidsubmitApplicationAttempt(FiCaSchedulerApp application, String userName, boolean isMoveApp) Submit an application attempt to the queue.toString()voidupdateClusterResource(org.apache.hadoop.yarn.api.records.Resource clusterResource, ResourceLimits resourceLimits) Update the cluster resource for queues as we add/remove nodesvoidupdateClusterResourceLegacyMode(org.apache.hadoop.yarn.api.records.Resource clusterResource, ResourceLimits resourceLimits) voidvalidateSubmitApplication(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, String userName, String queue) Validate submitApplication api so that moveApplication do a pre-check.Methods inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.AbstractCSQueue
accept, activateQueue, appFinished, assignContainers, checkConfigTypeIsAbsoluteResource, decPendingResource, decReservedResource, decUsedResource, getAbsoluteCapacity, getAbsoluteMaximumCapacity, getAbsoluteUsedCapacity, getAccessibleNodeLabels, getACLs, getCapacity, getCapacityConfigType, getCapacityOrWeightString, getConfiguredCapacityVector, getConfiguredMaxCapacityVector, getConfiguredNodeLabels, getDefaultApplicationLifetime, getDefaultApplicationPriority, getDefaultAppLifetimeWasSpecifiedInConfig, getDefaultNodeLabelExpression, getEffectiveCapacity, getEffectiveCapacityDown, getEffectiveMaxCapacity, getEffectiveMaxCapacityDown, getIntraQueuePreemptionDisabled, getIntraQueuePreemptionDisabledInHierarchy, getKillableContainers, getMaximumAbsoluteResource, getMaximumAllocation, getMaximumApplicationLifetime, getMaximumCapacity, getMaxParallelApps, getMetrics, getMinimumAbsoluteResource, getMinimumAllocation, getMultiNodeSortingPolicyClassName, getNodeLabelsForQueue, getNumContainers, getParent, getPreemptionDisabled, getPriority, getPrivilegedEntity, getQueueCapacities, getQueueContext, getQueueInfo, getQueueName, getQueuePath, getQueuePathObject, getQueueResourceQuotas, getQueueResourceUsage, getQueueShortName, getReadLock, getState, getTotalKillableResource, getUsedCapacity, getUsedResources, getUserWeights, getWriteLock, hasAccess, incPendingResource, incReservedResource, incUsedResource, isDynamicQueue, isInactiveDynamicQueue, isReservationsContinueLooking, overrideCapacityVectorsForSpecialQueues, parseAndSetDynamicTemplates, recoverDrainingState, releaseResource, setConfiguredMaxCapacityVector, setConfiguredMinCapacityVector, setDynamicQueue, setMaxParallelApps, setMultiNodeSortingPolicyClassName, setParent, setupConfigurableCapacities, updateAbsoluteCapacities, updateCapacityConfigType, updateConfigurableResourceLimits, updateQueueState
-
Field Details
-
childQueues
-
-
Constructor Details
-
AbstractParentQueue
public AbstractParentQueue(CapacitySchedulerQueueContext queueContext, String queueName, CSQueue parent, CSQueue old) throws IOException - Throws:
IOException
-
AbstractParentQueue
public AbstractParentQueue(CapacitySchedulerQueueContext queueContext, String queueName, CSQueue parent, CSQueue old, boolean isDynamic) throws IOException - Throws:
IOException
-
-
Method Details
-
setupQueueConfigs
protected void setupQueueConfigs(org.apache.hadoop.yarn.api.records.Resource clusterResource) throws IOException Description copied from class:AbstractCSQueueInitialize queue properties that are based on configuration.- Overrides:
setupQueueConfigsin classAbstractCSQueue- Parameters:
clusterResource- overall resource of the cluster- Throws:
IOException- if configuration is set in a way that is inconsistent
-
setDynamicQueueACLProperties
protected void setDynamicQueueACLProperties()- Overrides:
setDynamicQueueACLPropertiesin classAbstractCSQueue
-
getCapacityConfigurationTypeForQueues
public AbstractParentQueue.QueueCapacityType getCapacityConfigurationTypeForQueues(Collection<CSQueue> queues) throws IOException - Throws:
IOException
-
getQueueInfo
public org.apache.hadoop.yarn.api.records.QueueInfo getQueueInfo(boolean includeChildQueues, boolean recursive) Description copied from interface:QueueGet queue information- Parameters:
includeChildQueues- include child queues?recursive- recursively get child queue information?- Returns:
- queue information
-
getQueueUserAclInfo
public List<org.apache.hadoop.yarn.api.records.QueueUserACLInfo> getQueueUserAclInfo(org.apache.hadoop.security.UserGroupInformation user) Description copied from interface:QueueGet queue ACLs for givenuser.- Parameters:
user- username- Returns:
- queue ACLs for user
-
toString
-
createNewQueue
public CSQueue createNewQueue(String childQueuePath, boolean isLeaf) throws SchedulerDynamicEditException - Throws:
SchedulerDynamicEditException
-
removeChildQueue
- Throws:
SchedulerDynamicEditException
-
isEligibleForAutoQueueCreation
public boolean isEligibleForAutoQueueCreation()Check whether this queue supports adding additional child queues dynamically.- Returns:
- true, if queue is eligible to create additional queues dynamically, false otherwise
-
isEligibleForLegacyAutoQueueCreation
public boolean isEligibleForLegacyAutoQueueCreation()Check whether this queue supports legacy(v1) dynamic child queue creation.- Returns:
- true if queue is eligible to create child queues dynamically using the legacy system, false otherwise
-
reinitialize
public void reinitialize(CSQueue newlyParsedQueue, org.apache.hadoop.yarn.api.records.Resource clusterResource) throws IOException Description copied from interface:CSQueueReinitialize the queue.- Parameters:
newlyParsedQueue- new queue to re-initalize fromclusterResource- resources in the cluster- Throws:
IOException- an I/O exception has occurred.
-
submitApplication
public void submitApplication(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, String user, String queue) throws org.apache.hadoop.security.AccessControlException Description copied from interface:CSQueueSubmit a new application to the queue.- Parameters:
applicationId- the applicationId of the application being submitteduser- user who submitted the applicationqueue- queue to which the application is submitted- Throws:
org.apache.hadoop.security.AccessControlException- if any acl violation is there.
-
validateSubmitApplication
public void validateSubmitApplication(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, String userName, String queue) throws org.apache.hadoop.security.AccessControlException Description copied from interface:CSQueueValidate submitApplication api so that moveApplication do a pre-check.- Specified by:
validateSubmitApplicationin interfaceCSQueue- Overrides:
validateSubmitApplicationin classAbstractCSQueue- Parameters:
applicationId- Application IDuserName- User Namequeue- Queue Name- Throws:
org.apache.hadoop.security.AccessControlException- if any acl violation is there.
-
submitApplicationAttempt
Description copied from interface:CSQueueSubmit an application attempt to the queue.- Parameters:
application- application whose attempt is being submitted.userName- userName who submitted the application.
-
submitApplicationAttempt
public void submitApplicationAttempt(FiCaSchedulerApp application, String userName, boolean isMoveApp) Description copied from interface:CSQueueSubmit an application attempt to the queue.- Parameters:
application- application whose attempt is being submitteduserName- user who submitted the application attemptisMoveApp- is application being moved across the queue
-
finishApplicationAttempt
Description copied from interface:CSQueueAn application attempt submitted to this queue has finished.- Parameters:
application- application attempt.queue- queue.
-
finishApplication
public void finishApplication(org.apache.hadoop.yarn.api.records.ApplicationId application, String user) Description copied from interface:CSQueueAn application submitted to this queue has finished.- Parameters:
application- applicationId.user- user who submitted the application
-
assignContainers
public CSAssignment assignContainers(org.apache.hadoop.yarn.api.records.Resource clusterResource, CandidateNodeSet<FiCaSchedulerNode> candidates, ResourceLimits resourceLimits, SchedulingMode schedulingMode) Description copied from interface:CSQueueAssign containers to applications in the queue or it's children (if any).- Parameters:
clusterResource- the resource of the cluster.candidates-CandidateNodeSetthe nodes that are considered for the current placement.resourceLimits- how much overall resource of this queue can use.schedulingMode- Type of exclusive check when assign container on a NodeManager, seeSchedulingMode.- Returns:
- the assignment
-
getResourceLimitsOfChild
public ResourceLimits getResourceLimitsOfChild(CSQueue child, org.apache.hadoop.yarn.api.records.Resource clusterResource, ResourceLimits parentLimits, String nodePartition, boolean netLimit) -
completedContainer
public void completedContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource, FiCaSchedulerApp application, FiCaSchedulerNode node, RMContainer rmContainer, org.apache.hadoop.yarn.api.records.ContainerStatus containerStatus, RMContainerEventType event, CSQueue completedChildQueue, boolean sortQueues) Description copied from interface:CSQueueA container assigned to the queue has completed.- Parameters:
clusterResource- the resource of the clusterapplication- application to which the container was assignednode- node on which the container completedrmContainer- completed container,nullif it was just a reservationcontainerStatus-ContainerStatusfor the completed containerevent- event to be sent to the containercompletedChildQueue-CSQueueto reinsert in childQueuessortQueues- indicates whether it should re-sort the queues
-
refreshAfterResourceCalculation
public void refreshAfterResourceCalculation(org.apache.hadoop.yarn.api.records.Resource clusterResource, ResourceLimits resourceLimits) -
updateClusterResource
public void updateClusterResource(org.apache.hadoop.yarn.api.records.Resource clusterResource, ResourceLimits resourceLimits) Description copied from interface:CSQueueUpdate the cluster resource for queues as we add/remove nodes- Parameters:
clusterResource- the current cluster resourceresourceLimits- the current ResourceLimits
-
updateClusterResourceLegacyMode
public void updateClusterResourceLegacyMode(org.apache.hadoop.yarn.api.records.Resource clusterResource, ResourceLimits resourceLimits) -
hasChildQueues
public boolean hasChildQueues() -
getChildQueues
Description copied from interface:CSQueueGet child queues- Returns:
- child queues
-
getChildQueuesByTryLock
Description copied from interface:CSQueueGet child queues By tryLock.- Returns:
- child queues
-
recoverContainer
public void recoverContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource, SchedulerApplicationAttempt attempt, RMContainer rmContainer) Description copied from interface:QueueRecover the state of the queue for a given container.- Parameters:
clusterResource- the resource of the clusterattempt- the application for which the container was allocatedrmContainer- the container that was recovered.
-
getAbstractUsersManager
Description copied from interface:CSQueueGet theAbstractUsersManagerfor the queue.- Returns:
- the
AbstractUsersManagerfor the queue
-
collectSchedulerApplications
public void collectSchedulerApplications(Collection<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> apps) Description copied from interface:CSQueueAdds all applications in the queue and its subqueues to the given collection.- Parameters:
apps- the collection to add the applications to
-
attachContainer
public void attachContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource, FiCaSchedulerApp application, RMContainer rmContainer) Description copied from interface:CSQueueAttach a container to this queue- Parameters:
clusterResource- the current cluster resourceapplication- application to which the container was assignedrmContainer- the container to attach
-
detachContainer
public void detachContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource, FiCaSchedulerApp application, RMContainer rmContainer) Description copied from interface:CSQueueDetach a container from this queue- Parameters:
clusterResource- the current cluster resourceapplication- application to which the container was assignedrmContainer- the container to detach
-
getNumApplications
public int getNumApplications()Description copied from interface:CSQueueGet the number of applications in the queue.- Returns:
- number of applications
-
apply
public void apply(org.apache.hadoop.yarn.api.records.Resource cluster, ResourceCommitRequest<FiCaSchedulerApp, FiCaSchedulerNode> request) -
stopQueue
public void stopQueue()Description copied from interface:SchedulerQueueStop the queue. -
getQueueOrderingPolicy
-
isEligibleForAutoDeletion
public boolean isEligibleForAutoDeletion()Description copied from class:AbstractCSQueueChecks whether this queue is a dynamic queue and could be deleted.- Overrides:
isEligibleForAutoDeletionin classAbstractCSQueue- Returns:
- true if the dynamic queue could be deleted, false otherwise
-
getAutoCreatedQueueTemplate
-