Class BatchScheduler

All Implemented Interfaces:

public class BatchScheduler extends AbstractScheduler
  • Constructor Details

    • BatchScheduler

      public BatchScheduler(String name, int quantity)
  • Method Details

    • completed

      public void completed(Task task)
    • resize

      public int resize(int level)
      Description copied from interface: Scheduler
      Set the number of desired tasks to the given level.
      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.
      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).
      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 the SchedulerState registered with Scheduler.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.
      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.