@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).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.
|
float |
getWeight()
Job/queue weight in fair sharing.
|
boolean |
isPreemptable()
Check whether the schedulable is preemptable.
|
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()
float getWeight()
long getStartTime()
org.apache.hadoop.yarn.api.records.Priority getPriority()
void updateDemand()
org.apache.hadoop.yarn.api.records.Resource assignContainer(FSSchedulerNode node)
node
- FSSchedulerNode.org.apache.hadoop.yarn.api.records.Resource getFairShare()
void setFairShare(org.apache.hadoop.yarn.api.records.Resource fairShare)
fairShare
- a fair share to this Schedulable.boolean isPreemptable()
true
if the schedulable is preemptable;
false
otherwiseCopyright © 2008–2024 Apache Software Foundation. All rights reserved.