Class AbstractScheduler

All Implemented Interfaces:
Direct Known Subclasses:
BatchScheduler, PersistentTaskScheduler

public abstract class AbstractScheduler extends Object implements Scheduler
  • Field Details

    • taskSpec

      protected TaskSpec taskSpec
    • priority

      protected int priority
    • failCount

      protected int failCount
    • taskManager

      protected Scheduler.TaskManager taskManager
    • state

      protected SchedulerState state
    • isTracked

      protected boolean isTracked
  • Constructor Details

    • AbstractScheduler

      public AbstractScheduler(String type, String name)
  • Method Details

    • setTaskManager

      public void setTaskManager(Scheduler.TaskManager taskManager)
    • registerState

      public void registerState(SchedulerState state)
      Description copied from interface: Scheduler
      Register the state object that tracks tasks launched by this scheduler.
      Specified by:
      registerState in interface Scheduler
    • setPriority

      public void setPriority(int priority)
      Description copied from interface: Scheduler
      Controller-assigned priority for this scheduler. Used to differentiate container requests by scheduler.
      Specified by:
      setPriority in interface Scheduler
    • getName

      public String getName()
      Specified by:
      getName in interface Scheduler
    • getType

      public String getType()
      Specified by:
      getType in interface Scheduler
    • getTaskManager

      public Scheduler.TaskManager getTaskManager()
      Specified by:
      getTaskManager in interface Scheduler
    • change

      public void change(int delta)
      Description copied from interface: Scheduler
      Increase (positive) or decrease (negative) the number of desired tasks by the given amount.
      Specified by:
      change in interface Scheduler
    • addTasks

      protected void addTasks(int n)
    • isTracked

      public boolean isTracked()
      Description copied from interface: Scheduler
      Whether tasks from this scheduler should incorporate app startup/shutdown acknowledgements (acks) into the task lifecycle.
      Specified by:
      isTracked in interface Scheduler
    • getResource

      public ContainerRequestSpec getResource()
      Description copied from interface: Scheduler
      For reporting, get the YARN resources requested by processes in this pool.
      Specified by:
      getResource in interface Scheduler
      The request spec.
    • limitContainerSize

      public void limitContainerSize(org.apache.hadoop.yarn.api.records.Resource maxResource) throws AMException
      Specified by:
      limitContainerSize in interface Scheduler
    • getRequestTimeoutSec

      public int getRequestTimeoutSec()
      Description copied from interface: Scheduler
      Maximum amount of time to wait when cancelling a job in the REQUESTING state. YARN will happily wait forever for a resource, this setting forcibly cancels the request at timeout.
      Specified by:
      getRequestTimeoutSec in interface Scheduler
      the number of seconds to wait for timeout. 0 means no timeout