Package org.apache.cassandra.concurrent
Class SEPExecutor
- java.lang.Object
-
- org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService
-
- org.apache.cassandra.concurrent.SEPExecutor
-
- All Implemented Interfaces:
java.util.concurrent.Executor,java.util.concurrent.ExecutorService,LocalAwareExecutorService,ResizableThreadPool,SEPExecutorMBean
public class SEPExecutor extends AbstractLocalAwareExecutorService implements SEPExecutorMBean
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSEPExecutor.TakeTaskPermitResult-
Nested classes/interfaces inherited from interface org.apache.cassandra.concurrent.LocalAwareExecutorService
LocalAwareExecutorService.MaximumPoolSizeListener
-
-
Field Summary
Fields Modifier and Type Field Description ThreadPoolMetricsmetricsjava.lang.Stringnameprotected java.util.concurrent.ConcurrentLinkedQueue<org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService.FutureTask<?>>tasks
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddTask(org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService.FutureTask<?> task)booleanawaitTermination(long timeout, java.util.concurrent.TimeUnit unit)intgetActiveTaskCount()Returns the approximate number of threads that are actively executing tasks.longgetCompletedTaskCount()Returns the approximate total number of tasks that have completed execution.intgetCorePoolSize()Returns maximum pool size of thread pool.intgetMaximumPoolSize()Returns maximum pool size of thread pool.intgetMaxTasksQueued()intgetPendingTaskCount()Returns the approximate total of tasks waiting to be executed.booleanisShutdown()booleanisTerminated()voidmaybeExecuteImmediately(java.lang.Runnable command)protected voidonCompletion()voidsetCorePoolSize(int newCorePoolSize)Allows user to resize maximum size of the thread pool.voidsetMaximumPoolSize(int newMaximumPoolSize)Allows user to resize maximum size of the thread pool.voidshutdown()java.util.List<java.lang.Runnable>shutdownNow()-
Methods inherited from class org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService
execute, execute, invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, newTaskFor, newTaskFor, submit, submit, submit
-
-
-
-
Field Detail
-
name
public final java.lang.String name
-
metrics
public final ThreadPoolMetrics metrics
-
tasks
protected final java.util.concurrent.ConcurrentLinkedQueue<org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService.FutureTask<?>> tasks
-
-
Method Detail
-
onCompletion
protected void onCompletion()
- Specified by:
onCompletionin classAbstractLocalAwareExecutorService
-
getMaxTasksQueued
public int getMaxTasksQueued()
- Specified by:
getMaxTasksQueuedin interfaceLocalAwareExecutorService
-
addTask
protected void addTask(org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService.FutureTask<?> task)
- Specified by:
addTaskin classAbstractLocalAwareExecutorService
-
maybeExecuteImmediately
public void maybeExecuteImmediately(java.lang.Runnable command)
- Specified by:
maybeExecuteImmediatelyin interfaceLocalAwareExecutorService
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfacejava.util.concurrent.ExecutorService
-
shutdownNow
public java.util.List<java.lang.Runnable> shutdownNow()
- Specified by:
shutdownNowin interfacejava.util.concurrent.ExecutorService
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdownin interfacejava.util.concurrent.ExecutorService
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminatedin interfacejava.util.concurrent.ExecutorService
-
awaitTermination
public boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException- Specified by:
awaitTerminationin interfacejava.util.concurrent.ExecutorService- Throws:
java.lang.InterruptedException
-
getPendingTaskCount
public int getPendingTaskCount()
Description copied from interface:LocalAwareExecutorServiceReturns the approximate total of tasks waiting to be executed. Because the states of tasks and threads may change dynamically during computation, the returned value is only an approximation, but one that does not ever decrease across successive calls.- Specified by:
getPendingTaskCountin interfaceLocalAwareExecutorService- Returns:
- the number of tasks
-
getCompletedTaskCount
public long getCompletedTaskCount()
Description copied from interface:LocalAwareExecutorServiceReturns the approximate total number of tasks that have completed execution. Because the states of tasks and threads may change dynamically during computation, the returned value is only an approximation, but one that does not ever decrease across successive calls.- Specified by:
getCompletedTaskCountin interfaceLocalAwareExecutorService- Returns:
- the number of tasks
-
getActiveTaskCount
public int getActiveTaskCount()
Description copied from interface:LocalAwareExecutorServiceReturns the approximate number of threads that are actively executing tasks.- Specified by:
getActiveTaskCountin interfaceLocalAwareExecutorService- Returns:
- the number of threads
-
getCorePoolSize
public int getCorePoolSize()
Description copied from interface:ResizableThreadPoolReturns maximum pool size of thread pool.- Specified by:
getCorePoolSizein interfaceResizableThreadPool
-
setCorePoolSize
public void setCorePoolSize(int newCorePoolSize)
Description copied from interface:ResizableThreadPoolAllows user to resize maximum size of the thread pool.- Specified by:
setCorePoolSizein interfaceResizableThreadPool
-
getMaximumPoolSize
public int getMaximumPoolSize()
Description copied from interface:ResizableThreadPoolReturns maximum pool size of thread pool.- Specified by:
getMaximumPoolSizein interfaceResizableThreadPool
-
setMaximumPoolSize
public void setMaximumPoolSize(int newMaximumPoolSize)
Description copied from interface:ResizableThreadPoolAllows user to resize maximum size of the thread pool.- Specified by:
setMaximumPoolSizein interfaceResizableThreadPool
-
-