public abstract class PersistentTaskScheduler extends AbstractScheduler
Provides a target quantity of tasks
(see getTarget()
, along with operations to increase,
decrease or set the target number.
The scheduler acts as a controller: starting new tasks as needed to match the desired target, or stopping tasks as needed when the target level is reduced.
Scheduler.TaskManager
Modifier and Type | Field and Description |
---|---|
protected int |
quantity |
failCount, isTracked, priority, state, taskManager, taskSpec
Constructor and Description |
---|
PersistentTaskScheduler(String type,
String name,
int quantity) |
Modifier and Type | Method and Description |
---|---|
void |
adjust()
Adjust the number of running tasks to better match the target
by starting or stopping tasks as needed.
|
void |
completed(Task task)
Indicate that a task is completed.
|
int[] |
getProgress()
Progress for persistent tasks defaults to the ratio of
running tasks to target level.
|
int |
getTarget()
Get the desired number of running tasks.
|
boolean |
hasMoreTasks()
The persistent scheduler has no fixed sequence of tasks to run, it launches
a set and is never "done".
|
void |
requestTimedOut()
Informs the scheduler that a YARN resource request timed out.
|
int |
resize(int level)
Set the number of running tasks to the quantity given.
|
addTasks, change, getName, getRequestTimeoutSec, getResource, getTaskManager, getType, isTracked, limitContainerSize, registerState, setPriority, setTaskManager
public int resize(int level)
level
- the target number of taskspublic int getTarget()
Scheduler
public void completed(Task task)
task
- public int[] getProgress()
public void adjust()
public boolean hasMoreTasks()
public void requestTimedOut()
Scheduler
Copyright © 1970 The Apache Software Foundation. All rights reserved.