Class FairScheduler

java.lang.Object
io.trino.execution.executor.scheduler.FairScheduler
All Implemented Interfaces:
AutoCloseable

@ThreadSafe public final class FairScheduler extends Object implements AutoCloseable

Implementation nodes

  • The TaskControl state machine is only modified by the task executor thread (i.e., from within runTask(Schedulable, TaskControl) )}). Other threads can indirectly affect what the task executor thread does by marking the task as ready or cancelled and unblocking the task executor thread, which will then act on that information.
  • Field Details

    • QUANTUM_NANOS

      public static final long QUANTUM_NANOS
  • Constructor Details

    • FairScheduler

      public FairScheduler(int maxConcurrentTasks, String threadNameFormat, com.google.common.base.Ticker ticker)
  • Method Details

    • newInstance

      public static FairScheduler newInstance(int maxConcurrentTasks)
    • newInstance

      public static FairScheduler newInstance(int maxConcurrentTasks, com.google.common.base.Ticker ticker)
    • start

      public void start()
    • pause

      public void pause()
    • resume

      public void resume()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • createGroup

      public Group createGroup(String name)
    • removeGroup

      public void removeGroup(Group group)
    • getTasks

      public Set<Integer> getTasks(Group group)
    • submit

      public com.google.common.util.concurrent.ListenableFuture<Void> submit(Group group, int id, Schedulable runner)
    • toString

      public String toString()
      Overrides:
      toString in class Object