@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, wait
getActiveUsersManager, getQueueUserAclInfo, recoverContainer
assignContainer, getDemand, getResourceUsage, preemptContainer, updateDemand
protected 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()
Schedulable
getName
in interface Schedulable
public String getQueueName()
Queue
getQueueName
in interface Queue
public SchedulingPolicy getPolicy()
public FSParentQueue getParent()
protected void throwPolicyDoesnotApplyException(SchedulingPolicy policy) throws AllocationConfigurationException
AllocationConfigurationException
public abstract void setPolicy(SchedulingPolicy policy) throws AllocationConfigurationException
AllocationConfigurationException
public ResourceWeights getWeights()
Schedulable
getWeights
in interface Schedulable
public org.apache.hadoop.yarn.api.records.Resource getMinShare()
Schedulable
getMinShare
in interface Schedulable
public org.apache.hadoop.yarn.api.records.Resource getMaxShare()
Schedulable
getMaxShare
in interface Schedulable
public long getStartTime()
Schedulable
getStartTime
in interface Schedulable
public org.apache.hadoop.yarn.api.records.Priority getPriority()
Schedulable
getPriority
in interface Schedulable
public org.apache.hadoop.yarn.api.records.QueueInfo getQueueInfo(boolean includeChildQueues, boolean recursive)
Queue
getQueueInfo
in interface Queue
includeChildQueues
- include child queues?recursive
- recursively get child queue information?public org.apache.hadoop.yarn.api.records.QueueStatistics getQueueStatistics()
public FSQueueMetrics getMetrics()
Queue
getMetrics
in interface Queue
public org.apache.hadoop.yarn.api.records.Resource getFairShare()
getFairShare
in interface Schedulable
public void setFairShare(org.apache.hadoop.yarn.api.records.Resource fairShare)
Schedulable
setFairShare
in interface Schedulable
public 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()
Queue
getAccessibleNodeLabels
in interface Queue
public String getDefaultNodeLabelExpression()
Queue
getDefaultNodeLabelExpression
in interface Queue
public void incPendingResource(String nodeLabel, org.apache.hadoop.yarn.api.records.Resource resourceToInc)
Queue
incPendingResource
in interface Queue
nodeLabel
- asked by applicationresourceToInc
- new resource askedpublic void decPendingResource(String nodeLabel, org.apache.hadoop.yarn.api.records.Resource resourceToDec)
Queue
decPendingResource
in interface Queue
nodeLabel
- asked by applicationresourceToDec
- new resource askedpublic void incReservedResource(String nodeLabel, org.apache.hadoop.yarn.api.records.Resource resourceToInc)
Queue
incReservedResource
in interface Queue
nodeLabel
- asked by applicationresourceToInc
- reserved resource askedpublic void decReservedResource(String nodeLabel, org.apache.hadoop.yarn.api.records.Resource resourceToDec)
Queue
decReservedResource
in interface Queue
nodeLabel
- asked by applicationresourceToDec
- reserved resource askedpublic org.apache.hadoop.yarn.api.records.Priority getDefaultApplicationPriority()
Queue
getDefaultApplicationPriority
in interface Queue
public boolean fitsInMaxShare(org.apache.hadoop.yarn.api.records.Resource additionalResource)
Copyright © 2017 Apache Software Foundation. All Rights Reserved.