Class FSLeafQueue
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSQueue
org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSLeafQueue
- All Implemented Interfaces:
Schedulable,Queue
-
Field Summary
Fields inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSQueue
maxAMShare, maxContainerAllocation, maxRunningApps, minShare, parent, policy, recordFactory, scheduler, weights -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAssignedApp(org.apache.hadoop.yarn.api.records.ApplicationId applicationId) This method is called when an application is assigned to this queue for book-keeping purposes (to be able to determine if the queue is empty).org.apache.hadoop.yarn.api.records.ResourceAssign a container on this node if possible, and return the amount of resources assigned.booleancanRunAppAM(org.apache.hadoop.yarn.api.records.Resource amResource) Check whether this queue can run the Application Master under the maxAMShare limit.voidcollectSchedulerApplications(Collection<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> apps) Adds all applications in the queue and its subqueues to the given collection.protected voidRecursively dump states of all queues.Gets the children of this queue, if any.org.apache.hadoop.yarn.api.records.ResourceMaximum number of resources required by this Schedulable.org.apache.hadoop.yarn.api.records.ResourceintTODO: Based on how frequently this is called, we might want to club counting pending and active apps in the same method.intintintReturn the number of apps for which containers can be allocated.List<org.apache.hadoop.yarn.api.records.QueueUserACLInfo>getQueueUserAclInfo(org.apache.hadoop.security.UserGroupInformation user) Get queue ACLs for givenuser.booleanisEmpty()voidrecoverContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource, SchedulerApplicationAttempt schedulerAttempt, RMContainer rmContainer) Recover the state of the queue for a given container.voidremoveAssignedApp(org.apache.hadoop.yarn.api.records.ApplicationId applicationId) This method is called when an application is removed from this queue during the submit process.voidsetWeights(float weight) Allows setting weight for a dynamically created queue.voidRefresh the Schedulable's demand and those of its children if any.Methods inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSQueue
decPendingResource, decReservedResource, decUsedResource, dumpState, getAccessibleNodeLabels, getDefaultApplicationPriority, getDefaultNodeLabelExpression, getFairShare, getMaxAMShare, getMaxChildQueueResource, getMaxRunningApps, getMaxShare, getMetrics, getMinShare, getName, getParent, getPolicy, getPriority, getQueueInfo, getQueueName, getQueueStatistics, getRawMaxShare, getReservedResource, getResourceUsage, getStartTime, getSteadyFairShare, getWeight, hasAccess, incPendingResource, incReservedResource, incUsedResource, isActive, isDynamic, isPreemptable, reinit, setDynamic, setFairShare, setMaxAMShare, setMaxChildQueueResource, setMaxContainerAllocation, setMaxRunningApps, setMaxShare, setMinShare, setPolicy, toString, update, verifyAndSetPolicyFromConf
-
Constructor Details
-
FSLeafQueue
-
-
Method Details
-
collectSchedulerApplications
public void collectSchedulerApplications(Collection<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> apps) Description copied from class:FSQueueAdds all applications in the queue and its subqueues to the given collection.- Specified by:
collectSchedulerApplicationsin classFSQueue- Parameters:
apps- the collection to add the applications to
-
getDemand
public org.apache.hadoop.yarn.api.records.Resource getDemand()Description copied from interface:SchedulableMaximum number of resources required by this Schedulable. This is defined as number of currently utilized resources + number of unlaunched resources (that are either not yet launched or need to be speculated).- Returns:
- resources required by this Schedulable.
-
updateDemand
public void updateDemand()Description copied from interface:SchedulableRefresh the Schedulable's demand and those of its children if any. -
assignContainer
Description copied from interface:SchedulableAssign a container on this node if possible, and return the amount of resources assigned.- Parameters:
node- FSSchedulerNode.- Returns:
- the amount of resources assigned.
-
getChildQueues
Description copied from class:FSQueueGets the children of this queue, if any.- Specified by:
getChildQueuesin classFSQueue- Returns:
- the children of this queue.
-
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
-
getNumRunnableApps
public int getNumRunnableApps()Description copied from class:FSQueueReturn the number of apps for which containers can be allocated. Includes apps in subqueues.- Specified by:
getNumRunnableAppsin classFSQueue- Returns:
- the number of apps.
-
getNumPendingApps
public int getNumPendingApps() -
getNumAssignedApps
public int getNumAssignedApps() -
isEmpty
public boolean isEmpty() -
getNumActiveApps
public int getNumActiveApps()TODO: Based on how frequently this is called, we might want to club counting pending and active apps in the same method.- Returns:
- active apps.
-
getAbstractUsersManager
-
canRunAppAM
public boolean canRunAppAM(org.apache.hadoop.yarn.api.records.Resource amResource) Check whether this queue can run the Application Master under the maxAMShare limit.- Parameters:
amResource- resources required to run the AM- Returns:
- true if this queue can run
-
recoverContainer
public void recoverContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource, SchedulerApplicationAttempt schedulerAttempt, RMContainer rmContainer) Description copied from interface:QueueRecover the state of the queue for a given container.- Parameters:
clusterResource- the resource of the clusterschedulerAttempt- the application for which the container was allocatedrmContainer- the container that was recovered.
-
setWeights
public void setWeights(float weight) Allows setting weight for a dynamically created queue. Currently only used for reservation based queues.- Overrides:
setWeightsin classFSQueue- Parameters:
weight- queue weight
-
getMaximumContainerAllocation
public org.apache.hadoop.yarn.api.records.Resource getMaximumContainerAllocation()- Specified by:
getMaximumContainerAllocationin classFSQueue
-
dumpStateInternal
Description copied from class:FSQueueRecursively dump states of all queues.- Specified by:
dumpStateInternalin classFSQueue- Parameters:
sb- the {code StringBuilder} which holds queue states
-
addAssignedApp
public void addAssignedApp(org.apache.hadoop.yarn.api.records.ApplicationId applicationId) This method is called when an application is assigned to this queue for book-keeping purposes (to be able to determine if the queue is empty).- Parameters:
applicationId- the application's id
-
removeAssignedApp
public void removeAssignedApp(org.apache.hadoop.yarn.api.records.ApplicationId applicationId) This method is called when an application is removed from this queue during the submit process.- Parameters:
applicationId- the application's id
-