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 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

      boolean requestContainers(EventContext context, int maxRequests)
      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

      void shutDown(EventContext context)
      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

      void visitTaskModels(TaskVisitor visitor)
    • checkTasks

      void checkTasks(EventContext context, long curTime)
    • cancel

      void cancel(Task task)
    • getTask

      Task getTask(int id)