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:
Executor,ExecutorService,ExecutorPlus,ResizableThreadPool,SequentialExecutorPlus
- Direct Known Subclasses:
LocalAwareSingleThreadExecutorPlus
public class SingleThreadExecutorPlus
extends ThreadPoolExecutorPlus
implements SequentialExecutorPlus
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicyNested classes/interfaces inherited from interface org.apache.cassandra.concurrent.ExecutorPlus
ExecutorPlus.MaximumPoolSizeListenerNested 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
Modifier and TypeMethodDescriptionReturn an object for orchestrating the execution of this task at least once (in its entirety) after the trigger is invoked, i.e.intReturns 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).intReturns maximum pool size of thread pool.voidsetCorePoolSize(int number) Allows user to resize minimum size of the thread pool.voidsetMaximumPoolSize(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, submitMethods inherited from class org.apache.cassandra.concurrent.ThreadPoolExecutorBase
getActiveTaskCount, getCoreThreads, getMaximumThreads, getPendingTaskCount, getThreadFactory, onShutdown, onShutdown, setCoreThreads, setMaximumThreads, shutdown, shutdownNow, terminated, toStringMethods 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, setThreadFactoryMethods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAnyMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.cassandra.concurrent.ExecutorPlus
execute, inExecutor, invokeAll, invokeAll, invokeAny, invokeAny, maybeExecuteImmediately, submit, submit, submit, submit, submit, submitMethods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, isShutdown, isTerminated, shutdown, shutdownNowMethods inherited from interface org.apache.cassandra.concurrent.ResizableThreadPool
getActiveTaskCount, getCompletedTaskCount, getMaxTasksQueued, getPendingTaskCount, oldestTaskQueueTime
-
Method Details
-
getCorePoolSize
public int getCorePoolSize()Description copied from interface:ResizableThreadPoolReturns 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:
getCorePoolSizein interfaceResizableThreadPool- Overrides:
getCorePoolSizein classThreadPoolExecutor
-
setCorePoolSize
public void setCorePoolSize(int number) Description copied from interface:ResizableThreadPoolAllows user to resize minimum size of the thread pool.- Specified by:
setCorePoolSizein interfaceResizableThreadPool- Overrides:
setCorePoolSizein classThreadPoolExecutor
-
getMaximumPoolSize
public int getMaximumPoolSize()Description copied from interface:ResizableThreadPoolReturns maximum pool size of thread pool.- Specified by:
getMaximumPoolSizein interfaceResizableThreadPool- Overrides:
getMaximumPoolSizein classThreadPoolExecutor
-
setMaximumPoolSize
public void setMaximumPoolSize(int number) Description copied from interface:ResizableThreadPoolAllows user to resize maximum size of the thread pool.- Specified by:
setMaximumPoolSizein interfaceResizableThreadPool- Overrides:
setMaximumPoolSizein classThreadPoolExecutor
-
atLeastOnceTrigger
Description copied from interface:SequentialExecutorPlusReturn 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:
atLeastOnceTriggerin interfaceSequentialExecutorPlus
-