Package org.apache.cassandra.concurrent
Class InfiniteLoopExecutor
java.lang.Object
org.apache.cassandra.concurrent.InfiniteLoopExecutor
- All Implemented Interfaces:
Interruptible,Shutdownable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enumstatic enumNested classes/interfaces inherited from interface org.apache.cassandra.concurrent.Interruptible
Interruptible.SimpleTask, Interruptible.State, Interruptible.Task, Interruptible.TerminateException -
Constructor Summary
ConstructorsConstructorDescriptionInfiniteLoopExecutor(String name, Interruptible.Task task, InfiniteLoopExecutor.Daemon daemon) InfiniteLoopExecutor(BiFunction<String, Runnable, Thread> threadStarter, String name, Interruptible.Task task, InfiniteLoopExecutor.Interrupts interrupts) InfiniteLoopExecutor(ExecutorFactory factory, String name, Interruptible.Task task, InfiniteLoopExecutor.Daemon daemon) InfiniteLoopExecutor(ExecutorFactory factory, String name, Interruptible.Task task, InfiniteLoopExecutor.Daemon daemon, InfiniteLoopExecutor.Interrupts interrupts) -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long time, TimeUnit unit) Await termination of this object, i.e.voidbooleanisAlive()booleanvoidshutdown()Shutdown once any remaining work has completed (however this is defined for the implementation).Shutdown immediately, possibly interrupting ongoing work, and cancelling work that is queued.
-
Constructor Details
-
InfiniteLoopExecutor
public InfiniteLoopExecutor(String name, Interruptible.Task task, InfiniteLoopExecutor.Daemon daemon) -
InfiniteLoopExecutor
public InfiniteLoopExecutor(ExecutorFactory factory, String name, Interruptible.Task task, InfiniteLoopExecutor.Daemon daemon) -
InfiniteLoopExecutor
public InfiniteLoopExecutor(ExecutorFactory factory, String name, Interruptible.Task task, InfiniteLoopExecutor.Daemon daemon, InfiniteLoopExecutor.Interrupts interrupts) -
InfiniteLoopExecutor
public InfiniteLoopExecutor(BiFunction<String, Runnable, Thread> threadStarter, String name, Interruptible.Task task, InfiniteLoopExecutor.Interrupts interrupts)
-
-
Method Details
-
interrupt
public void interrupt()- Specified by:
interruptin interfaceInterruptible
-
shutdown
public void shutdown()Description copied from interface:ShutdownableShutdown once any remaining work has completed (however this is defined for the implementation).- Specified by:
shutdownin interfaceShutdownable
-
shutdownNow
Description copied from interface:ShutdownableShutdown immediately, possibly interrupting ongoing work, and cancelling work that is queued.- Specified by:
shutdownNowin interfaceShutdownable
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceShutdownable
-
awaitTermination
Description copied from interface:ShutdownableAwait termination of this object, i.e. the cessation of all current and future work.- Specified by:
awaitTerminationin interfaceShutdownable- Throws:
InterruptedException
-
isAlive
public boolean isAlive()
-