Package org.apache.cassandra.concurrent
Class SingleThreadExecutorPlus
- java.lang.Object
-
- java.util.concurrent.AbstractExecutorService
-
- java.util.concurrent.ThreadPoolExecutor
-
- org.apache.cassandra.concurrent.ThreadPoolExecutorBase
-
- org.apache.cassandra.concurrent.ThreadPoolExecutorPlus
-
- org.apache.cassandra.concurrent.SingleThreadExecutorPlus
-
- All Implemented Interfaces:
java.util.concurrent.Executor
,java.util.concurrent.ExecutorService
,ExecutorPlus
,ResizableThreadPool
,SequentialExecutorPlus
- Direct Known Subclasses:
LocalAwareSingleThreadExecutorPlus
public class SingleThreadExecutorPlus extends ThreadPoolExecutorPlus implements SequentialExecutorPlus
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SingleThreadExecutorPlus.AtLeastOnce
-
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy
-
Nested classes/interfaces inherited from interface org.apache.cassandra.concurrent.ExecutorPlus
ExecutorPlus.MaximumPoolSizeListener
-
Nested classes/interfaces inherited from interface org.apache.cassandra.concurrent.SequentialExecutorPlus
SequentialExecutorPlus.AtLeastOnceTrigger
-
-
Field Summary
-
Fields inherited from class org.apache.cassandra.concurrent.ThreadPoolExecutorBase
blockingExecutionHandler
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SingleThreadExecutorPlus.AtLeastOnce
atLeastOnceTrigger(java.lang.Runnable run)
Return an object for orchestrating the execution of this task at least once (in its entirety) after the trigger is invoked, i.e.int
getCorePoolSize()
Returns core pool size of thread pool, the minimum number of workers (where that makes sense for a thread pool, SEPExecutor does not have a minimum size).int
getMaximumPoolSize()
Returns maximum pool size of thread pool.void
setCorePoolSize(int number)
Allows user to resize minimum size of the thread pool.void
setMaximumPoolSize(int number)
Allows user to resize maximum size of the thread pool.-
Methods inherited from class org.apache.cassandra.concurrent.ThreadPoolExecutorPlus
execute, execute, getMaxTasksQueued, inExecutor, newTaskFor, newTaskFor, submit, submit, submit, submit, submit, submit
-
Methods inherited from class org.apache.cassandra.concurrent.ThreadPoolExecutorBase
getActiveTaskCount, getCoreThreads, getMaximumThreads, getPendingTaskCount, getThreadFactory, onShutdown, onShutdown, setCoreThreads, setMaximumThreads, shutdown, shutdownNow, terminated, toString
-
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, finalize, getActiveCount, getCompletedTaskCount, getKeepAliveTime, getLargestPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setKeepAliveTime, setRejectedExecutionHandler, setThreadFactory
-
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.concurrent.ExecutorPlus
execute, inExecutor, invokeAll, invokeAll, invokeAny, invokeAny, maybeExecuteImmediately, submit, submit, submit, submit, submit, submit
-
Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, isShutdown, isTerminated, shutdown, shutdownNow
-
Methods inherited from interface org.apache.cassandra.concurrent.ResizableThreadPool
getActiveTaskCount, getCompletedTaskCount, getMaxTasksQueued, getPendingTaskCount, oldestTaskQueueTime
-
-
-
-
Method Detail
-
getCorePoolSize
public int getCorePoolSize()
Description copied from interface:ResizableThreadPool
Returns core pool size of thread pool, the minimum number of workers (where that makes sense for a thread pool, SEPExecutor does not have a minimum size).- Specified by:
getCorePoolSize
in interfaceResizableThreadPool
- Overrides:
getCorePoolSize
in classjava.util.concurrent.ThreadPoolExecutor
-
setCorePoolSize
public void setCorePoolSize(int number)
Description copied from interface:ResizableThreadPool
Allows user to resize minimum size of the thread pool.- Specified by:
setCorePoolSize
in interfaceResizableThreadPool
- Overrides:
setCorePoolSize
in classjava.util.concurrent.ThreadPoolExecutor
-
getMaximumPoolSize
public int getMaximumPoolSize()
Description copied from interface:ResizableThreadPool
Returns maximum pool size of thread pool.- Specified by:
getMaximumPoolSize
in interfaceResizableThreadPool
- Overrides:
getMaximumPoolSize
in classjava.util.concurrent.ThreadPoolExecutor
-
setMaximumPoolSize
public void setMaximumPoolSize(int number)
Description copied from interface:ResizableThreadPool
Allows user to resize maximum size of the thread pool.- Specified by:
setMaximumPoolSize
in interfaceResizableThreadPool
- Overrides:
setMaximumPoolSize
in classjava.util.concurrent.ThreadPoolExecutor
-
atLeastOnceTrigger
public SingleThreadExecutorPlus.AtLeastOnce atLeastOnceTrigger(java.lang.Runnable run)
Description copied from interface:SequentialExecutorPlus
Return an object for orchestrating the execution of this task at least once (in its entirety) after the trigger is invoked, i.e. saturating the number of pending tasks at 1 (2 including any possibly executing at the time of invocation)- Specified by:
atLeastOnceTrigger
in interfaceSequentialExecutorPlus
-
-