@InterfaceAudience.Private @InterfaceStability.Unstable public abstract class FSQueue extends Object implements Queue, Schedulable
Queue.QueueLabelPolicy
Modifier and Type | Field and Description |
---|---|
protected net.java.dev.eval.Expression |
label |
protected Queue.QueueLabelPolicy |
labelPolicy |
protected FSParentQueue |
parent |
protected SchedulingPolicy |
policy |
protected org.apache.hadoop.yarn.factories.RecordFactory |
recordFactory |
protected FairScheduler |
scheduler |
LABEL_NONE
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
|
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.
|
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.
|
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() |
net.java.dev.eval.Expression |
getLabel() |
Queue.QueueLabelPolicy |
getLabelPolicy() |
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
|
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) |
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
|
protected net.java.dev.eval.Expression |
refreshLabel() |
protected Queue.QueueLabelPolicy |
refreshLabelPolicy() |
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 |
setLabel(net.java.dev.eval.Expression label) |
void |
setLabelPolicy(Queue.QueueLabelPolicy labelPolicy) |
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 net.java.dev.eval.Expression label
protected Queue.QueueLabelPolicy labelPolicy
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 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 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
protected net.java.dev.eval.Expression refreshLabel()
protected Queue.QueueLabelPolicy refreshLabelPolicy()
public Queue.QueueLabelPolicy getLabelPolicy()
getLabelPolicy
in interface Queue
public void setLabel(net.java.dev.eval.Expression label)
public void setLabelPolicy(Queue.QueueLabelPolicy labelPolicy)
Copyright © 2015 Apache Software Foundation. All Rights Reserved.