@InterfaceAudience.Private @InterfaceStability.Unstable public class FSLeafQueue extends FSQueue
parent, policy, recordFactory, scheduler| Constructor and Description |
|---|
FSLeafQueue(String name,
FairScheduler scheduler,
FSParentQueue parent) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAMResourceUsage(org.apache.hadoop.yarn.api.records.Resource amResource) |
void |
addApp(FSAppAttempt app,
boolean runnable) |
org.apache.hadoop.yarn.api.records.Resource |
assignContainer(FSSchedulerNode node)
Assign a container on this node if possible, and return the amount of
resources assigned.
|
boolean |
canRunAppAM(org.apache.hadoop.yarn.api.records.Resource amResource)
Check whether this queue can run this application master under the
maxAMShare limit
|
void |
clearPreemptedResources() |
void |
collectSchedulerApplications(Collection<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> apps)
Adds all applications in the queue and its subqueues to the given collection.
|
ActiveUsersManager |
getActiveUsersManager() |
org.apache.hadoop.yarn.api.records.Resource |
getAmResourceUsage() |
List<FSQueue> |
getChildQueues()
Gets the children of this queue, if any.
|
List<FSAppAttempt> |
getCopyOfNonRunnableAppSchedulables() |
org.apache.hadoop.yarn.api.records.Resource |
getDemand()
Maximum number of resources required by this Schedulable.
|
long |
getLastTimeAtFairShareThreshold() |
long |
getLastTimeAtMinShare() |
int |
getNumActiveApps()
TODO: Based on how frequently this is called, we might want to club
counting pending and active apps in the same method.
|
int |
getNumNonRunnableApps() |
int |
getNumPendingApps() |
int |
getNumRunnableApps()
Return 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 given
user. |
org.apache.hadoop.yarn.api.records.Resource |
getResourceUsage()
Get the aggregate amount of resources consumed by the schedulable.
|
boolean |
isNonRunnableApp(FSAppAttempt attempt) |
boolean |
isRunnableApp(FSAppAttempt attempt) |
RMContainer |
preemptContainer()
Preempt a container from this Schedulable if possible.
|
void |
recomputeShares()
Recomputes the shares for all child queues and applications based on this
queue's current share
|
void |
recoverContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource,
SchedulerApplicationAttempt schedulerAttempt,
RMContainer rmContainer)
Recover the state of the queue for a given container.
|
boolean |
removeApp(FSAppAttempt app)
Removes the given app from this queue.
|
boolean |
removeNonRunnableApp(FSAppAttempt app)
Removes the given app if it is non-runnable and belongs to this queue
|
void |
resetPreemptedResources() |
void |
setPolicy(SchedulingPolicy policy) |
void |
setWeights(float weight)
Allows setting weight for a dynamically created queue
Currently only used for reservation based queues
|
void |
updateDemand()
Refresh the Schedulable's demand and those of its children if any.
|
void |
updateStarvationStats()
Update the preemption fields for the queue, i.e.
|
assignContainerPreCheck, getAccessibleNodeLabels, getDefaultNodeLabelExpression, getFairShare, getFairSharePreemptionThreshold, getFairSharePreemptionTimeout, getMaxShare, getMetrics, getMinShare, getMinSharePreemptionTimeout, getName, getParent, getPolicy, getPriority, getQueueInfo, getQueueName, getStartTime, getSteadyFairShare, getWeights, hasAccess, isActive, setFairShare, setFairSharePreemptionThreshold, setFairSharePreemptionTimeout, setMinSharePreemptionTimeout, setSteadyFairShare, throwPolicyDoesnotApplyException, toString, updatePreemptionVariablespublic FSLeafQueue(String name, FairScheduler scheduler, FSParentQueue parent)
public void addApp(FSAppAttempt app, boolean runnable)
public boolean removeApp(FSAppAttempt app)
public boolean removeNonRunnableApp(FSAppAttempt app)
public boolean isRunnableApp(FSAppAttempt attempt)
public boolean isNonRunnableApp(FSAppAttempt attempt)
public void resetPreemptedResources()
public void clearPreemptedResources()
public List<FSAppAttempt> getCopyOfNonRunnableAppSchedulables()
public void collectSchedulerApplications(Collection<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> apps)
FSQueuecollectSchedulerApplications in class FSQueueapps - the collection to add the applications topublic void setPolicy(SchedulingPolicy policy) throws AllocationConfigurationException
setPolicy in class FSQueueAllocationConfigurationExceptionpublic void recomputeShares()
FSQueuerecomputeShares in class FSQueuepublic org.apache.hadoop.yarn.api.records.Resource getDemand()
Schedulablepublic org.apache.hadoop.yarn.api.records.Resource getResourceUsage()
Schedulablepublic org.apache.hadoop.yarn.api.records.Resource getAmResourceUsage()
public void updateDemand()
Schedulablepublic org.apache.hadoop.yarn.api.records.Resource assignContainer(FSSchedulerNode node)
Schedulablepublic RMContainer preemptContainer()
Schedulablepublic List<FSQueue> getChildQueues()
FSQueuegetChildQueues in class FSQueuepublic List<org.apache.hadoop.yarn.api.records.QueueUserACLInfo> getQueueUserAclInfo(org.apache.hadoop.security.UserGroupInformation user)
Queueuser.user - usernamepublic long getLastTimeAtMinShare()
public long getLastTimeAtFairShareThreshold()
public int getNumRunnableApps()
FSQueuegetNumRunnableApps in class FSQueuepublic int getNumNonRunnableApps()
public int getNumPendingApps()
public int getNumActiveApps()
public ActiveUsersManager getActiveUsersManager()
public boolean canRunAppAM(org.apache.hadoop.yarn.api.records.Resource amResource)
amResource - public void addAMResourceUsage(org.apache.hadoop.yarn.api.records.Resource amResource)
public void recoverContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource,
SchedulerApplicationAttempt schedulerAttempt,
RMContainer rmContainer)
QueueclusterResource - the resource of the clusterschedulerAttempt - the application for which the container was allocatedrmContainer - the container that was recovered.public void updateStarvationStats()
public void setWeights(float weight)
weight - queue weightCopyright © 2016 Apache Software Foundation. All Rights Reserved.