@InterfaceAudience.Private
@InterfaceStability.Unstable
public interface Schedulable
assignContainer(org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSSchedulerNode)
.
2) It provides information about the app/queue to the scheduler, including:
- Demand (maximum number of tasks required)
- 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).Modifier and Type | Method and Description |
---|---|
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 |
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.
|
org.apache.hadoop.yarn.api.records.Resource |
getMaxShare()
Maximum Resource share assigned to the schedulable.
|
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.
|
long |
getStartTime()
Start time for jobs in FIFO queues; meaningless for QueueSchedulables.
|
ResourceWeights |
getWeights()
Job/queue weight in fair sharing.
|
RMContainer |
preemptContainer()
Preempt a container from this Schedulable if possible.
|
void |
setFairShare(org.apache.hadoop.yarn.api.records.Resource fairShare)
Assign a fair share to this Schedulable.
|
void |
updateDemand()
Refresh the Schedulable's demand and those of its children if any.
|
String getName()
org.apache.hadoop.yarn.api.records.Resource getDemand()
org.apache.hadoop.yarn.api.records.Resource getResourceUsage()
org.apache.hadoop.yarn.api.records.Resource getMinShare()
org.apache.hadoop.yarn.api.records.Resource getMaxShare()
ResourceWeights getWeights()
long getStartTime()
org.apache.hadoop.yarn.api.records.Priority getPriority()
void updateDemand()
org.apache.hadoop.yarn.api.records.Resource assignContainer(FSSchedulerNode node)
RMContainer preemptContainer()
org.apache.hadoop.yarn.api.records.Resource getFairShare()
void setFairShare(org.apache.hadoop.yarn.api.records.Resource fairShare)
Copyright © 2017 Apache Software Foundation. All Rights Reserved.