Package org.apache.drill.yarn.appMaster
Interface SchedulerStateActions
- All Known Implementing Classes:
SchedulerStateImpl
public interface SchedulerStateActions
Represents the set of commands called by the cluster controller to manage the
state of tasks within a task group. Each task group is managed by a
scheduler.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdjust the number of running tasks as needed to balance the number of running tasks with the desired number.voidvoidcheckTasks(EventContext context, long curTime) voidcontainerAllocated(EventContext context, org.apache.hadoop.yarn.api.records.Container container) A container request has been granted.intgetName()Returns the name of the scheduler associated with this task action group.intReturns the scheduler associated with this task group.getTask(int id) intbooleanisDone()Determine if this task group is done.booleanrequestContainers(EventContext context, int maxRequests) Request a container the first task that we wish to start.voidshutDown(EventContext context) Shut down this task group by canceling all tasks not already cancelled.voidvisitTaskModels(TaskVisitor visitor)
-
Method Details
-
getName
String getName()Returns the name of the scheduler associated with this task action group.- Returns:
- The name of the scheduler associated with this task action group.
-
getScheduler
Scheduler getScheduler()Returns the scheduler associated with this task group.- Returns:
- The scheduler associated with this task group.
-
adjustTasks
void adjustTasks()Adjust the number of running tasks as needed to balance the number of running tasks with the desired number. May result in no change it the cluster is already in balance (or is in the process of achieving balance.) -
requestContainers
Request a container the first task that we wish to start. -
containerAllocated
void containerAllocated(EventContext context, org.apache.hadoop.yarn.api.records.Container container) A container request has been granted. Match the container up with the first task waiting for a container and launch the task.- Parameters:
context-container-
-
shutDown
Shut down this task group by canceling all tasks not already cancelled.- Parameters:
context-
-
isDone
boolean isDone()Determine if this task group is done. It is done when there are no active tasks and the controller itself is shutting down. This latter check differentiates the start state (when no tasks are active) from the end state. The AM will not shut down until all task groups are done.- Returns:
- True if this task group is done. False otherwise.
-
getTaskCount
int getTaskCount() -
getLiveCount
int getLiveCount() -
getRequestCount
int getRequestCount() -
visitTaskModels
-
checkTasks
-
cancel
-
getTask
-