@InterfaceAudience.Private @InterfaceStability.Unstable public abstract class FSQueue extends Object implements Queue, Schedulable
| Modifier and Type | Field and Description |
|---|---|
protected FSParentQueue |
parent |
protected SchedulingPolicy |
policy |
protected org.apache.hadoop.yarn.factories.RecordFactory |
recordFactory |
protected FairScheduler |
scheduler |
| Constructor and Description |
|---|
FSQueue(String name,
FairScheduler scheduler,
FSParentQueue parent) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
assignContainerPreCheck(FSSchedulerNode node)
Helper method to check if the queue should attempt assigning resources
|
boolean |
canBePreempted()
Recursively check if the queue can be preempted based on whether the
resource usage is greater than fair share.
|
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
|
boolean |
fitsInMaxShare(org.apache.hadoop.yarn.api.records.Resource additionalResource) |
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.
|
float |
getFairSharePreemptionThreshold() |
long |
getFairSharePreemptionTimeout() |
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.
|
long |
getMinSharePreemptionTimeout() |
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() |
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.
|
ResourceWeights |
getWeights()
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
|
boolean |
isActive()
Returns true if queue has at least one app running.
|
abstract void |
recomputeShares()
Recomputes the shares for all child queues and applications based on this
queue's current share
|
void |
setFairShare(org.apache.hadoop.yarn.api.records.Resource fairShare)
Assign a fair share to this Schedulable.
|
void |
setFairSharePreemptionThreshold(float fairSharePreemptionThreshold) |
void |
setFairSharePreemptionTimeout(long fairSharePreemptionTimeout) |
void |
setMinSharePreemptionTimeout(long minSharePreemptionTimeout) |
abstract void |
setPolicy(SchedulingPolicy policy) |
void |
setSteadyFairShare(org.apache.hadoop.yarn.api.records.Resource steadyFairShare) |
protected void |
throwPolicyDoesnotApplyException(SchedulingPolicy policy) |
String |
toString()
Convenient toString implementation for debugging.
|
void |
updatePreemptionVariables()
Update the min/fair share preemption timeouts and threshold for this queue.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetActiveUsersManager, getQueueUserAclInfo, recoverContainerassignContainer, getDemand, getResourceUsage, preemptContainer, updateDemandprotected final FairScheduler scheduler
protected final FSParentQueue parent
protected final org.apache.hadoop.yarn.factories.RecordFactory recordFactory
protected SchedulingPolicy policy
public FSQueue(String name, FairScheduler scheduler, FSParentQueue parent)
public String getName()
SchedulablegetName in interface Schedulablepublic String getQueueName()
QueuegetQueueName in interface Queuepublic SchedulingPolicy getPolicy()
public FSParentQueue getParent()
protected void throwPolicyDoesnotApplyException(SchedulingPolicy policy) throws AllocationConfigurationException
AllocationConfigurationExceptionpublic abstract void setPolicy(SchedulingPolicy policy) throws AllocationConfigurationException
AllocationConfigurationExceptionpublic ResourceWeights getWeights()
SchedulablegetWeights in interface Schedulablepublic org.apache.hadoop.yarn.api.records.Resource getMinShare()
SchedulablegetMinShare in interface Schedulablepublic org.apache.hadoop.yarn.api.records.Resource getMaxShare()
SchedulablegetMaxShare in interface Schedulablepublic 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 void setSteadyFairShare(org.apache.hadoop.yarn.api.records.Resource steadyFairShare)
public boolean hasAccess(org.apache.hadoop.yarn.api.records.QueueACL acl,
org.apache.hadoop.security.UserGroupInformation user)
public long getFairSharePreemptionTimeout()
public void setFairSharePreemptionTimeout(long fairSharePreemptionTimeout)
public long getMinSharePreemptionTimeout()
public void setMinSharePreemptionTimeout(long minSharePreemptionTimeout)
public float getFairSharePreemptionThreshold()
public void setFairSharePreemptionThreshold(float fairSharePreemptionThreshold)
public boolean canBePreempted()
public abstract void recomputeShares()
public void updatePreemptionVariables()
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()
protected boolean assignContainerPreCheck(FSSchedulerNode node)
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.Priority getDefaultApplicationPriority()
QueuegetDefaultApplicationPriority in interface Queuepublic boolean fitsInMaxShare(org.apache.hadoop.yarn.api.records.Resource additionalResource)
Copyright © 2017 Apache Software Foundation. All Rights Reserved.