Class FairScheduler
java.lang.Object
io.trino.execution.executor.scheduler.FairScheduler
- All Implemented Interfaces:
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFairScheduler(int maxConcurrentTasks, String threadNameFormat, com.google.common.base.Ticker ticker) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()createGroup(String name) static FairSchedulernewInstance(int maxConcurrentTasks) static FairSchedulernewInstance(int maxConcurrentTasks, com.google.common.base.Ticker ticker) voidpause()voidremoveGroup(Group group) voidresume()voidstart()com.google.common.util.concurrent.ListenableFuture<Void> submit(Group group, int id, Schedulable runner) toString()
-
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
-
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:
closein interfaceAutoCloseable
-
createGroup
-
removeGroup
-
getTasks
-
submit
public com.google.common.util.concurrent.ListenableFuture<Void> submit(Group group, int id, Schedulable runner) -
toString
-