Package org.apache.drill.yarn.appMaster
Class BatchScheduler
java.lang.Object
org.apache.drill.yarn.appMaster.AbstractScheduler
org.apache.drill.yarn.appMaster.BatchScheduler
- All Implemented Interfaces:
Scheduler
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.drill.yarn.appMaster.Scheduler
Scheduler.TaskManager
-
Field Summary
Fields inherited from class org.apache.drill.yarn.appMaster.AbstractScheduler
failCount, isTracked, priority, state, taskManager, taskSpec
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
adjust()
Adjust the number of running tasks to better track the desired number.void
int[]
Return an estimate of progress given as a ratio of (work completed, total work).int
Get the desired number of running tasks.boolean
If this is a batch scheduler, whether all tasks for the batch have completed.void
Informs the scheduler that a YARN resource request timed out.int
resize
(int level) Set the number of desired tasks to the given level.Methods inherited from class org.apache.drill.yarn.appMaster.AbstractScheduler
addTasks, change, getName, getRequestTimeoutSec, getResource, getTaskManager, getType, isTracked, limitContainerSize, registerState, setPriority, setTaskManager
-
Constructor Details
-
BatchScheduler
-
-
Method Details
-
completed
-
resize
public int resize(int level) Description copied from interface:Scheduler
Set the number of desired tasks to the given level.- Returns:
- the actual resize level, which may be lower than the requested level if the system cannot provide the requested level
-
getTarget
public int getTarget()Description copied from interface:Scheduler
Get the desired number of running tasks.- Returns:
- The desired number of running tasks
-
getProgress
public int[] getProgress()Description copied from interface:Scheduler
Return an estimate of progress given as a ratio of (work completed, total work).- Returns:
- Estimate of progress.
-
adjust
public void adjust()Description copied from interface:Scheduler
Adjust the number of running tasks to better track the desired number. Starts or stops tasks using theSchedulerState
registered withScheduler.registerState(SchedulerState)
. -
hasMoreTasks
public boolean hasMoreTasks()Description copied from interface:Scheduler
If this is a batch scheduler, whether all tasks for the batch have completed. If this is a persistent task scheduler, always returns false.- Returns:
- true if the scheduler has more tasks to run, false if the scheduler has no more tasks or manages a set of long-running tasks
-
requestTimedOut
public void requestTimedOut()Description copied from interface:Scheduler
Informs the scheduler that a YARN resource request timed out. The scheduler can either retry or (more productively) assume that the requested node is not available and adjust its target size downward.
-