|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.Schedulable
@InterfaceAudience.Private @InterfaceStability.Unstable public abstract class Schedulable
A Schedulable represents an entity that can launch tasks, such as a job or a queue. It provides a common interface so that algorithms such as fair sharing can be applied both within a queue and across queues. There are currently two types of Schedulables: JobSchedulables, which represent a single job, and QueueSchedulables, which allocate among jobs in their queue. Separate sets of Schedulables are used for maps and reduces. Each queue has both a mapSchedulable and a reduceSchedulable, and so does each job. A Schedulable is responsible for three roles: 1) It can launch tasks through assignTask(). 2) It provides information about the job/queue to the scheduler, including: - Demand (maximum number of tasks required) - Number of currently running tasks - Minimum share (for queues) - Job/queue weight (for fair sharing) - Start time and priority (for FIFO) 3) It can be assigned a fair share, for use with fair scheduling. Schedulable also contains two methods for performing scheduling computations: - updateDemand() is called periodically to compute the demand of the various jobs and queues, which may be expensive (e.g. jobs must iterate through all their tasks to count failed tasks, tasks that can be speculated, etc). - redistributeShare() is called after demands are updated and a Schedulable's fair share has been set by its parent to let it distribute its share among the other Schedulables within it (e.g. for queues that want to perform fair sharing among their jobs).
Constructor Summary | |
---|---|
Schedulable()
|
Method Summary | |
---|---|
abstract 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. |
abstract org.apache.hadoop.yarn.api.records.Resource |
getDemand()
Maximum number of resources required by this Schedulable. |
org.apache.hadoop.yarn.api.records.Resource |
getFairShare()
Get the fair share assigned to this Schedulable. |
abstract org.apache.hadoop.yarn.api.records.Resource |
getMaxShare()
Maximum Resource share assigned to the schedulable. |
abstract org.apache.hadoop.yarn.api.records.Resource |
getMinShare()
Minimum Resource share assigned to the schedulable. |
abstract String |
getName()
Name of job/queue, used for debugging as well as for breaking ties in scheduling order deterministically. |
abstract org.apache.hadoop.yarn.api.records.Priority |
getPriority()
Job priority for jobs in FIFO queues; meaningless for QueueSchedulables. |
abstract org.apache.hadoop.yarn.api.records.Resource |
getResourceUsage()
Get the aggregate amount of resources consumed by the schedulable. |
abstract long |
getStartTime()
Start time for jobs in FIFO queues; meaningless for QueueSchedulables. |
abstract ResourceWeights |
getWeights()
Job/queue weight in fair sharing. |
void |
setFairShare(org.apache.hadoop.yarn.api.records.Resource fairShare)
Assign a fair share to this Schedulable. |
String |
toString()
Convenient toString implementation for debugging. |
abstract void |
updateDemand()
Refresh the Schedulable's demand and those of its children if any. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Schedulable()
Method Detail |
---|
public abstract String getName()
public abstract org.apache.hadoop.yarn.api.records.Resource getDemand()
public abstract org.apache.hadoop.yarn.api.records.Resource getResourceUsage()
public abstract org.apache.hadoop.yarn.api.records.Resource getMinShare()
public abstract org.apache.hadoop.yarn.api.records.Resource getMaxShare()
public abstract ResourceWeights getWeights()
public abstract long getStartTime()
public abstract org.apache.hadoop.yarn.api.records.Priority getPriority()
public abstract void updateDemand()
public abstract org.apache.hadoop.yarn.api.records.Resource assignContainer(FSSchedulerNode node)
public void setFairShare(org.apache.hadoop.yarn.api.records.Resource fairShare)
public org.apache.hadoop.yarn.api.records.Resource getFairShare()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |