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

java.lang.Object
  extended by org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.Schedulable
      extended by org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.AppSchedulable

@InterfaceAudience.Private
@InterfaceStability.Unstable
public class AppSchedulable
extends Schedulable


Constructor Summary
AppSchedulable(FairScheduler scheduler, FSSchedulerApp app, FSLeafQueue queue)
           
 
Method Summary
 org.apache.hadoop.yarn.api.records.Resource assignContainer(FSSchedulerNode node)
          Assign a container on this node if possible, and return the amount of resources assigned.
 org.apache.hadoop.yarn.api.records.Resource assignReservedContainer(FSSchedulerNode node)
           
 org.apache.hadoop.yarn.api.records.Container createContainer(FSSchedulerApp application, FSSchedulerNode node, org.apache.hadoop.yarn.api.records.Resource capability, org.apache.hadoop.yarn.api.records.Priority priority)
          Create and return a container object reflecting an allocation for the given appliction on the given node with the given capability and priority.
 FSSchedulerApp getApp()
           
 org.apache.hadoop.yarn.api.records.Resource getDemand()
          Maximum number of resources required by this Schedulable.
 org.apache.hadoop.yarn.api.records.Resource getMaxShare()
          Maximum Resource share assigned to the schedulable.
 QueueMetrics getMetrics()
          Get metrics reference from containing queue.
 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.
 org.apache.hadoop.yarn.api.records.Priority getPriority()
          Job priority for jobs in FIFO queues; meaningless for QueueSchedulables.
 org.apache.hadoop.yarn.api.records.Resource getResourceUsage()
          Get the aggregate amount of resources consumed by the schedulable.
 boolean getRunnable()
          Is this application runnable? Runnable means that the user and queue application counts are within configured quotas.
 long getStartTime()
          Start time for jobs in FIFO queues; meaningless for QueueSchedulables.
 ResourceWeights getWeights()
          Job/queue weight in fair sharing.
 boolean hasContainerForNode(org.apache.hadoop.yarn.api.records.Priority prio, FSSchedulerNode node)
          Whether this app has containers requests that could be satisfied on the given node, if the node had full space.
 void setRunnable(boolean runnable)
           
 void unreserve(org.apache.hadoop.yarn.api.records.Priority priority, FSSchedulerNode node)
          Remove the reservation on node at the given Priority.
 void updateDemand()
          Refresh the Schedulable's demand and those of its children if any.
 
Methods inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.Schedulable
getFairShare, setFairShare, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AppSchedulable

public AppSchedulable(FairScheduler scheduler,
                      FSSchedulerApp app,
                      FSLeafQueue queue)
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

getApp

public FSSchedulerApp getApp()

updateDemand

public void updateDemand()
Description copied from class: Schedulable
Refresh the Schedulable's demand and those of its children if any.

Specified by:
updateDemand in class Schedulable

getDemand

public org.apache.hadoop.yarn.api.records.Resource getDemand()
Description copied from class: Schedulable
Maximum number of resources required by this Schedulable. This is defined as number of currently utilized resources + number of unlaunched resources (that are either not yet launched or need to be speculated).

Specified by:
getDemand 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

getResourceUsage

public org.apache.hadoop.yarn.api.records.Resource getResourceUsage()
Description copied from class: Schedulable
Get the aggregate amount of resources consumed by the schedulable.

Specified by:
getResourceUsage 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

getMetrics

public QueueMetrics getMetrics()
Get metrics reference from containing queue.


getWeights

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

Specified by:
getWeights 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

getRunnable

public boolean getRunnable()
Is this application runnable? Runnable means that the user and queue application counts are within configured quotas.


setRunnable

public void setRunnable(boolean runnable)

createContainer

public org.apache.hadoop.yarn.api.records.Container createContainer(FSSchedulerApp application,
                                                                    FSSchedulerNode node,
                                                                    org.apache.hadoop.yarn.api.records.Resource capability,
                                                                    org.apache.hadoop.yarn.api.records.Priority priority)
Create and return a container object reflecting an allocation for the given appliction on the given node with the given capability and priority.


unreserve

public void unreserve(org.apache.hadoop.yarn.api.records.Priority priority,
                      FSSchedulerNode node)
Remove the reservation on node at the given Priority. This dispatches to the SchedulerApp and SchedulerNode handlers for an unreservation.


assignReservedContainer

public org.apache.hadoop.yarn.api.records.Resource assignReservedContainer(FSSchedulerNode node)

assignContainer

public org.apache.hadoop.yarn.api.records.Resource assignContainer(FSSchedulerNode node)
Description copied from class: Schedulable
Assign a container on this node if possible, and return the amount of resources assigned.

Specified by:
assignContainer in class Schedulable

hasContainerForNode

public boolean hasContainerForNode(org.apache.hadoop.yarn.api.records.Priority prio,
                                   FSSchedulerNode node)
Whether this app has containers requests that could be satisfied on the given node, if the node had full space.



Copyright © 2014 Apache Software Foundation. All Rights Reserved.