@InterfaceAudience.Private @InterfaceStability.Unstable public abstract class FSQueue extends Object implements Queue, Schedulable
| Modifier and Type | Field and Description |
|---|---|
protected float |
maxAMShare |
protected org.apache.hadoop.yarn.api.records.Resource |
maxContainerAllocation |
protected int |
maxRunningApps |
protected org.apache.hadoop.yarn.api.records.Resource |
minShare |
protected FSParentQueue |
parent |
protected SchedulingPolicy |
policy |
protected org.apache.hadoop.yarn.factories.RecordFactory |
recordFactory |
protected FairScheduler |
scheduler |
protected float |
weights |
| Constructor and Description |
|---|
FSQueue(String name,
FairScheduler scheduler,
FSParentQueue parent) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
collectSchedulerApplications(Collection<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> apps)
Adds all applications in the queue and its subqueues to the given collection.
|
void |
decPendingResource(String nodeLabel,
org.apache.hadoop.yarn.api.records.Resource resourceToDec)
When an outstanding resource is fulfilled or canceled, calling this will
decrease pending resource in a queue.
|
void |
decReservedResource(String nodeLabel,
org.apache.hadoop.yarn.api.records.Resource resourceToDec)
Decrement Reserved Capacity
|
protected void |
decUsedResource(org.apache.hadoop.yarn.api.records.Resource res)
Decrease resource usage for this queue and all parent queues.
|
String |
dumpState()
Recursively dump states of all queues.
|
protected abstract void |
dumpStateInternal(StringBuilder sb)
Recursively dump states of all queues.
|
Set<String> |
getAccessibleNodeLabels()
Get labels can be accessed of this queue
labels={*}, means this queue can access any label
labels={ }, means this queue cannot access any label except node without label
labels={a, b, c} means this queue can access a or b or c
|
abstract List<FSQueue> |
getChildQueues()
Gets the children of this queue, if any.
|
org.apache.hadoop.yarn.api.records.Priority |
getDefaultApplicationPriority()
Get the Default Application Priority for this queue
|
String |
getDefaultNodeLabelExpression()
Get default label expression of this queue.
|
org.apache.hadoop.yarn.api.records.Resource |
getFairShare()
Get the fair share assigned to this Schedulable.
|
protected float |
getMaxAMShare() |
ConfigurableResource |
getMaxChildQueueResource() |
abstract org.apache.hadoop.yarn.api.records.Resource |
getMaximumContainerAllocation() |
int |
getMaxRunningApps() |
org.apache.hadoop.yarn.api.records.Resource |
getMaxShare()
Maximum Resource share assigned to the schedulable.
|
FSQueueMetrics |
getMetrics()
Get the queue metrics
|
org.apache.hadoop.yarn.api.records.Resource |
getMinShare()
Minimum Resource share assigned to the schedulable.
|
String |
getName()
Name of job/queue, used for debugging as well as for breaking ties in
scheduling order deterministically.
|
abstract int |
getNumRunnableApps()
Return the number of apps for which containers can be allocated.
|
FSParentQueue |
getParent() |
SchedulingPolicy |
getPolicy() |
org.apache.hadoop.yarn.api.records.Priority |
getPriority()
Job priority for jobs in FIFO queues; meaningless for QueueSchedulables.
|
org.apache.hadoop.yarn.api.records.QueueInfo |
getQueueInfo(boolean includeChildQueues,
boolean recursive)
Get queue information
|
String |
getQueueName()
Get the queue name
|
org.apache.hadoop.yarn.api.records.QueueStatistics |
getQueueStatistics() |
org.apache.hadoop.yarn.api.records.Resource |
getReservedResource() |
org.apache.hadoop.yarn.api.records.Resource |
getResourceUsage()
Get the aggregate amount of resources consumed by the schedulable.
|
long |
getStartTime()
Start time for jobs in FIFO queues; meaningless for QueueSchedulables.
|
org.apache.hadoop.yarn.api.records.Resource |
getSteadyFairShare()
Get the steady fair share assigned to this Schedulable.
|
float |
getWeight()
Job/queue weight in fair sharing.
|
boolean |
hasAccess(org.apache.hadoop.yarn.api.records.QueueACL acl,
org.apache.hadoop.security.UserGroupInformation user) |
void |
incPendingResource(String nodeLabel,
org.apache.hadoop.yarn.api.records.Resource resourceToInc)
When new outstanding resource is asked, calling this will increase pending
resource in a queue.
|
void |
incReservedResource(String nodeLabel,
org.apache.hadoop.yarn.api.records.Resource resourceToInc)
Increment Reserved Capacity
|
protected void |
incUsedResource(org.apache.hadoop.yarn.api.records.Resource res)
Increase resource usage for this queue and all parent queues.
|
boolean |
isActive()
Returns true if queue has at least one app running.
|
boolean |
isDynamic() |
abstract boolean |
isEmpty() |
boolean |
isPreemptable()
Check whether the schedulable is preemptable.
|
void |
reinit(boolean recursive)
Initialize a queue by setting its queue-specific properties and its
metrics.
|
void |
setDynamic(boolean dynamic) |
void |
setFairShare(org.apache.hadoop.yarn.api.records.Resource fairShare)
Assign a fair share to this Schedulable.
|
void |
setMaxAMShare(float maxAMShare) |
void |
setMaxChildQueueResource(ConfigurableResource maxChildShare) |
void |
setMaxContainerAllocation(org.apache.hadoop.yarn.api.records.Resource maxContainerAllocation) |
void |
setMaxRunningApps(int maxRunningApps) |
void |
setMaxShare(ConfigurableResource maxShare) |
void |
setMinShare(org.apache.hadoop.yarn.api.records.Resource minShare) |
void |
setPolicy(SchedulingPolicy policy) |
void |
setWeights(float weights) |
String |
toString()
Convenient toString implementation for debugging.
|
void |
update(org.apache.hadoop.yarn.api.records.Resource fairShare)
Set the queue's fairshare and update the demand/fairshare of child
queues/applications.
|
boolean |
verifyAndSetPolicyFromConf(AllocationConfiguration queueConf)
Recursively check policies for queues in pre-order.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAbstractUsersManager, getQueueUserAclInfo, recoverContainerassignContainer, getDemand, updateDemandprotected final FairScheduler scheduler
protected final FSParentQueue parent
protected final org.apache.hadoop.yarn.factories.RecordFactory recordFactory
protected SchedulingPolicy policy
protected float weights
protected org.apache.hadoop.yarn.api.records.Resource minShare
protected int maxRunningApps
protected float maxAMShare
protected org.apache.hadoop.yarn.api.records.Resource maxContainerAllocation
public FSQueue(String name, FairScheduler scheduler, FSParentQueue parent)
public final void reinit(boolean recursive)
verifyAndSetPolicyFromConf(org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.AllocationConfiguration).recursive - whether child queues should be reinitialized recursivelypublic String getName()
SchedulablegetName in interface Schedulablepublic String getQueueName()
QueuegetQueueName in interface Queuepublic SchedulingPolicy getPolicy()
public FSParentQueue getParent()
public void setPolicy(SchedulingPolicy policy)
public void setWeights(float weights)
public float getWeight()
SchedulablegetWeight in interface Schedulablepublic void setMinShare(org.apache.hadoop.yarn.api.records.Resource minShare)
public org.apache.hadoop.yarn.api.records.Resource getMinShare()
SchedulablegetMinShare in interface Schedulablepublic void setMaxShare(ConfigurableResource maxShare)
public void setMaxContainerAllocation(org.apache.hadoop.yarn.api.records.Resource maxContainerAllocation)
public abstract org.apache.hadoop.yarn.api.records.Resource getMaximumContainerAllocation()
public org.apache.hadoop.yarn.api.records.Resource getMaxShare()
SchedulablegetMaxShare in interface Schedulablepublic org.apache.hadoop.yarn.api.records.Resource getReservedResource()
public void setMaxChildQueueResource(ConfigurableResource maxChildShare)
public ConfigurableResource getMaxChildQueueResource()
public void setMaxRunningApps(int maxRunningApps)
public int getMaxRunningApps()
protected float getMaxAMShare()
public void setMaxAMShare(float maxAMShare)
public long getStartTime()
SchedulablegetStartTime in interface Schedulablepublic org.apache.hadoop.yarn.api.records.Priority getPriority()
SchedulablegetPriority in interface Schedulablepublic org.apache.hadoop.yarn.api.records.QueueInfo getQueueInfo(boolean includeChildQueues,
boolean recursive)
QueuegetQueueInfo in interface QueueincludeChildQueues - include child queues?recursive - recursively get child queue information?public org.apache.hadoop.yarn.api.records.QueueStatistics getQueueStatistics()
public FSQueueMetrics getMetrics()
QueuegetMetrics in interface Queuepublic org.apache.hadoop.yarn.api.records.Resource getFairShare()
getFairShare in interface Schedulablepublic void setFairShare(org.apache.hadoop.yarn.api.records.Resource fairShare)
SchedulablesetFairShare in interface Schedulablepublic org.apache.hadoop.yarn.api.records.Resource getSteadyFairShare()
public boolean hasAccess(org.apache.hadoop.yarn.api.records.QueueACL acl,
org.apache.hadoop.security.UserGroupInformation user)
public boolean isPreemptable()
SchedulableisPreemptable in interface Schedulabletrue if the schedulable is preemptable;
false otherwisepublic void update(org.apache.hadoop.yarn.api.records.Resource fairShare)
fairShare - public abstract List<FSQueue> getChildQueues()
public abstract void collectSchedulerApplications(Collection<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> apps)
apps - the collection to add the applications topublic abstract int getNumRunnableApps()
public boolean isActive()
public String toString()
public Set<String> getAccessibleNodeLabels()
QueuegetAccessibleNodeLabels in interface Queuepublic String getDefaultNodeLabelExpression()
QueuegetDefaultNodeLabelExpression in interface Queuepublic void incPendingResource(String nodeLabel, org.apache.hadoop.yarn.api.records.Resource resourceToInc)
QueueincPendingResource in interface QueuenodeLabel - asked by applicationresourceToInc - new resource askedpublic void decPendingResource(String nodeLabel, org.apache.hadoop.yarn.api.records.Resource resourceToDec)
QueuedecPendingResource in interface QueuenodeLabel - asked by applicationresourceToDec - new resource askedpublic void incReservedResource(String nodeLabel, org.apache.hadoop.yarn.api.records.Resource resourceToInc)
QueueincReservedResource in interface QueuenodeLabel - asked by applicationresourceToInc - reserved resource askedpublic void decReservedResource(String nodeLabel, org.apache.hadoop.yarn.api.records.Resource resourceToDec)
QueuedecReservedResource in interface QueuenodeLabel - asked by applicationresourceToDec - reserved resource askedpublic org.apache.hadoop.yarn.api.records.Resource getResourceUsage()
SchedulablegetResourceUsage in interface Schedulableprotected void incUsedResource(org.apache.hadoop.yarn.api.records.Resource res)
res - the resource to increaseprotected void decUsedResource(org.apache.hadoop.yarn.api.records.Resource res)
res - the resource to decreasepublic org.apache.hadoop.yarn.api.records.Priority getDefaultApplicationPriority()
QueuegetDefaultApplicationPriority in interface Queuepublic boolean verifyAndSetPolicyFromConf(AllocationConfiguration queueConf)
FSQueue objects.
Set the policy for current queue if there is no policy violation for its
children. This method is invoked while reloading the allocation file.queueConf - allocation configurationpublic String dumpState()
protected abstract void dumpStateInternal(StringBuilder sb)
sb - the {code StringBuilder} which holds queue statespublic boolean isDynamic()
public void setDynamic(boolean dynamic)
public abstract boolean isEmpty()
Copyright © 2008–2022 Apache Software Foundation. All rights reserved.