@InterfaceAudience.Private @InterfaceStability.Unstable public class FSLeafQueue extends FSQueue
Queue.QueueLabelPolicy
label, labelPolicy, parent, policy, recordFactory, scheduler
LABEL_NONE
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() |
List<FSAppAttempt> |
getCopyOfRunnableAppSchedulables() |
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 |
resetNonEligibleForPreemptionSet() |
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, fitsInMaxShare, getAccessibleNodeLabels, getDefaultNodeLabelExpression, getFairShare, getFairSharePreemptionThreshold, getFairSharePreemptionTimeout, getLabel, getLabelPolicy, getMaxShare, getMetrics, getMinShare, getMinSharePreemptionTimeout, getName, getParent, getPolicy, getPriority, getQueueInfo, getQueueName, getStartTime, getSteadyFairShare, getWeights, hasAccess, isActive, refreshLabel, refreshLabelPolicy, setFairShare, setFairSharePreemptionThreshold, setFairSharePreemptionTimeout, setLabel, setLabelPolicy, setMinSharePreemptionTimeout, setSteadyFairShare, throwPolicyDoesnotApplyException, toString, updatePreemptionVariables
public 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 resetNonEligibleForPreemptionSet()
public void clearPreemptedResources()
public List<FSAppAttempt> getCopyOfRunnableAppSchedulables()
public List<FSAppAttempt> getCopyOfNonRunnableAppSchedulables()
public void collectSchedulerApplications(Collection<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> apps)
FSQueue
collectSchedulerApplications
in class FSQueue
apps
- the collection to add the applications topublic void setPolicy(SchedulingPolicy policy) throws AllocationConfigurationException
setPolicy
in class FSQueue
AllocationConfigurationException
public void recomputeShares()
FSQueue
recomputeShares
in class FSQueue
public org.apache.hadoop.yarn.api.records.Resource getDemand()
Schedulable
public org.apache.hadoop.yarn.api.records.Resource getResourceUsage()
Schedulable
public org.apache.hadoop.yarn.api.records.Resource getAmResourceUsage()
public void updateDemand()
Schedulable
public org.apache.hadoop.yarn.api.records.Resource assignContainer(FSSchedulerNode node)
Schedulable
public RMContainer preemptContainer()
Schedulable
public List<FSQueue> getChildQueues()
FSQueue
getChildQueues
in class FSQueue
public List<org.apache.hadoop.yarn.api.records.QueueUserACLInfo> getQueueUserAclInfo(org.apache.hadoop.security.UserGroupInformation user)
Queue
user
.user
- usernamepublic long getLastTimeAtMinShare()
public long getLastTimeAtFairShareThreshold()
public int getNumRunnableApps()
FSQueue
getNumRunnableApps
in class FSQueue
public 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)
Queue
clusterResource
- 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 © 2017 Apache Software Foundation. All Rights Reserved.