org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair
Class FSQueue

java.lang.Object
  extended by org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.Schedulable
      extended by org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSQueue
All Implemented Interfaces:
Queue
Direct Known Subclasses:
FSLeafQueue, FSParentQueue

@InterfaceAudience.Private
@InterfaceStability.Unstable
public abstract class FSQueue
extends Schedulable
implements Queue


Field Summary
protected  FSParentQueue parent
           
protected  SchedulingPolicy policy
           
protected  org.apache.hadoop.yarn.factories.RecordFactory recordFactory
           
 
Constructor Summary
FSQueue(String name, QueueManager queueMgr, FairScheduler scheduler, FSParentQueue parent)
           
 
Method Summary
protected  boolean assignContainerPreCheck(FSSchedulerNode node)
          Helper method to check if the queue should attempt assigning resources
abstract  Collection<FSQueue> getChildQueues()
          Gets the children of this queue, if any.
 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.
 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.
 ResourceWeights getWeights()
          Job/queue weight in fair sharing.
 boolean hasAccess(org.apache.hadoop.yarn.api.records.QueueACL acl, org.apache.hadoop.security.UserGroupInformation user)
           
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.
abstract  void setPolicy(SchedulingPolicy policy)
           
protected  void throwPolicyDoesnotApplyException(SchedulingPolicy policy)
           
 
Methods inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.Schedulable
assignContainer, getDemand, getFairShare, getResourceUsage, toString, updateDemand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.yarn.server.resourcemanager.scheduler.Queue
getQueueUserAclInfo
 

Field Detail

parent

protected final FSParentQueue parent

recordFactory

protected final org.apache.hadoop.yarn.factories.RecordFactory recordFactory

policy

protected SchedulingPolicy policy
Constructor Detail

FSQueue

public FSQueue(String name,
               QueueManager queueMgr,
               FairScheduler scheduler,
               FSParentQueue parent)
Method Detail

getName

public String getName()
Description copied from class: Schedulable
Name of job/queue, used for debugging as well as for breaking ties in scheduling order deterministically.

Specified by:
getName in class Schedulable

getQueueName

public String getQueueName()
Description copied from interface: Queue
Get the queue name

Specified by:
getQueueName in interface Queue
Returns:
queue name

getPolicy

public SchedulingPolicy getPolicy()

throwPolicyDoesnotApplyException

protected void throwPolicyDoesnotApplyException(SchedulingPolicy policy)
                                         throws AllocationConfigurationException
Throws:
AllocationConfigurationException

setPolicy

public abstract void setPolicy(SchedulingPolicy policy)
                        throws AllocationConfigurationException
Throws:
AllocationConfigurationException

getWeights

public ResourceWeights getWeights()
Description copied from class: Schedulable
Job/queue weight in fair sharing.

Specified by:
getWeights in class Schedulable

getMinShare

public org.apache.hadoop.yarn.api.records.Resource getMinShare()
Description copied from class: Schedulable
Minimum Resource share assigned to the schedulable.

Specified by:
getMinShare in class Schedulable

getMaxShare

public org.apache.hadoop.yarn.api.records.Resource getMaxShare()
Description copied from class: Schedulable
Maximum Resource share assigned to the schedulable.

Specified by:
getMaxShare in class Schedulable

getStartTime

public long getStartTime()
Description copied from class: Schedulable
Start time for jobs in FIFO queues; meaningless for QueueSchedulables.

Specified by:
getStartTime in class Schedulable

getPriority

public org.apache.hadoop.yarn.api.records.Priority getPriority()
Description copied from class: Schedulable
Job priority for jobs in FIFO queues; meaningless for QueueSchedulables.

Specified by:
getPriority in class Schedulable

getQueueInfo

public org.apache.hadoop.yarn.api.records.QueueInfo getQueueInfo(boolean includeChildQueues,
                                                                 boolean recursive)
Description copied from interface: Queue
Get queue information

Specified by:
getQueueInfo in interface Queue
Parameters:
includeChildQueues - include child queues?
recursive - recursively get child queue information?
Returns:
queue information

getMetrics

public FSQueueMetrics getMetrics()
Description copied from interface: Queue
Get the queue metrics

Specified by:
getMetrics in interface Queue
Returns:
the queue metrics

setFairShare

public void setFairShare(org.apache.hadoop.yarn.api.records.Resource fairShare)
Description copied from class: Schedulable
Assign a fair share to this Schedulable.

Overrides:
setFairShare in class Schedulable

hasAccess

public boolean hasAccess(org.apache.hadoop.yarn.api.records.QueueACL acl,
                         org.apache.hadoop.security.UserGroupInformation user)
Specified by:
hasAccess in interface Queue

recomputeShares

public abstract void recomputeShares()
Recomputes the shares for all child queues and applications based on this queue's current share


getChildQueues

public abstract Collection<FSQueue> getChildQueues()
Gets the children of this queue, if any.


assignContainerPreCheck

protected boolean assignContainerPreCheck(FSSchedulerNode node)
Helper method to check if the queue should attempt assigning resources

Returns:
true if check passes (can assign) or false otherwise


Copyright © 2014 Apache Software Foundation. All Rights Reserved.