Package org.apache.cassandra.concurrent
Class JMXEnabledThreadPoolExecutor
- java.lang.Object
-
- java.util.concurrent.AbstractExecutorService
-
- java.util.concurrent.ThreadPoolExecutor
-
- org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor
-
- org.apache.cassandra.concurrent.JMXEnabledThreadPoolExecutor
-
- All Implemented Interfaces:
java.util.concurrent.Executor,java.util.concurrent.ExecutorService,JMXEnabledThreadPoolExecutorMBean,LocalAwareExecutorService,ResizableThreadPool
- Direct Known Subclasses:
CompactionManager.ValidationExecutor,JMXEnabledSingleThreadExecutor
public class JMXEnabledThreadPoolExecutor extends DebuggableThreadPoolExecutor implements JMXEnabledThreadPoolExecutorMBean
This is a wrapper class for the ScheduledThreadPoolExecutor. It provides an implementation for the afterExecute() found in the ThreadPoolExecutor class to log any unexpected Runtime Exceptions.
-
-
Nested Class Summary
-
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.LocalAwareExecutorService
LocalAwareExecutorService.MaximumPoolSizeListener
-
-
Field Summary
Fields Modifier and Type Field Description ThreadPoolMetricsmetrics-
Fields inherited from class org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor
blockingExecutionHandler, logger
-
-
Constructor Summary
Constructors Constructor Description JMXEnabledThreadPoolExecutor(int corePoolSize, int maxPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, NamedThreadFactory threadFactory, java.lang.String jmxPath)JMXEnabledThreadPoolExecutor(int corePoolSize, int maxPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, NamedThreadFactory threadFactory, java.lang.String jmxPath, java.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler)JMXEnabledThreadPoolExecutor(int corePoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, NamedThreadFactory threadFactory, java.lang.String jmxPath)JMXEnabledThreadPoolExecutor(java.lang.String threadPoolName)JMXEnabledThreadPoolExecutor(java.lang.String threadPoolName, int priority)JMXEnabledThreadPoolExecutor(java.lang.String threadPoolName, java.lang.String jmxPath)JMXEnabledThreadPoolExecutor(NamedThreadFactory threadFactory, java.lang.String jmxPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intgetCoreThreads()Deprecated.intgetCurrentlyBlockedTasks()intgetMaximumThreads()Deprecated.intgetTotalBlockedTasks()protected voidonFinalAccept(java.lang.Runnable task)protected voidonFinalRejection(java.lang.Runnable task)protected voidonInitialRejection(java.lang.Runnable task)voidsetCoreThreads(int number)Deprecated.voidsetMaximumPoolSize(int newMaximumPoolSize)Allows user to resize maximum size of the thread pool.voidsetMaximumThreads(int number)Deprecated.voidshutdown()java.util.List<java.lang.Runnable>shutdownNow()-
Methods inherited from class org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor
afterExecute, beforeExecute, createCachedThreadpoolWithMaxSize, createWithFixedPoolSize, createWithMaximumPoolSize, execute, execute, extractThrowable, getActiveTaskCount, getPendingTaskCount, handleOrLog, logExceptionsAfterExecute, maybeExecuteImmediately, maybeResetLocalSessionWrapper, newTaskFor, newTaskFor
-
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setRejectedExecutionHandler, setThreadFactory, terminated, toString
-
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, submit, submit, submit
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, submit, submit, submit
-
Methods inherited from interface org.apache.cassandra.concurrent.LocalAwareExecutorService
getCompletedTaskCount, getMaxTasksQueued
-
Methods inherited from interface org.apache.cassandra.concurrent.ResizableThreadPool
getCorePoolSize, getMaximumPoolSize, setCorePoolSize
-
-
-
-
Field Detail
-
metrics
public final ThreadPoolMetrics metrics
-
-
Constructor Detail
-
JMXEnabledThreadPoolExecutor
public JMXEnabledThreadPoolExecutor(java.lang.String threadPoolName)
-
JMXEnabledThreadPoolExecutor
public JMXEnabledThreadPoolExecutor(java.lang.String threadPoolName, java.lang.String jmxPath)
-
JMXEnabledThreadPoolExecutor
public JMXEnabledThreadPoolExecutor(java.lang.String threadPoolName, int priority)
-
JMXEnabledThreadPoolExecutor
public JMXEnabledThreadPoolExecutor(NamedThreadFactory threadFactory, java.lang.String jmxPath)
-
JMXEnabledThreadPoolExecutor
public JMXEnabledThreadPoolExecutor(int corePoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, NamedThreadFactory threadFactory, java.lang.String jmxPath)
-
JMXEnabledThreadPoolExecutor
public JMXEnabledThreadPoolExecutor(int corePoolSize, int maxPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, NamedThreadFactory threadFactory, java.lang.String jmxPath)
-
JMXEnabledThreadPoolExecutor
public JMXEnabledThreadPoolExecutor(int corePoolSize, int maxPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, NamedThreadFactory threadFactory, java.lang.String jmxPath, java.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler)
-
-
Method Detail
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfacejava.util.concurrent.ExecutorService- Overrides:
shutdownin classjava.util.concurrent.ThreadPoolExecutor
-
shutdownNow
public java.util.List<java.lang.Runnable> shutdownNow()
- Specified by:
shutdownNowin interfacejava.util.concurrent.ExecutorService- Overrides:
shutdownNowin classjava.util.concurrent.ThreadPoolExecutor
-
getTotalBlockedTasks
public int getTotalBlockedTasks()
-
getCurrentlyBlockedTasks
public int getCurrentlyBlockedTasks()
-
getCoreThreads
@Deprecated public int getCoreThreads()
Deprecated.Description copied from interface:JMXEnabledThreadPoolExecutorMBeanReturns core pool size of thread pool. Deprecated, use getCorePoolSize instead.- Specified by:
getCoreThreadsin interfaceJMXEnabledThreadPoolExecutorMBean
-
setCoreThreads
@Deprecated public void setCoreThreads(int number)
Deprecated.Description copied from interface:JMXEnabledThreadPoolExecutorMBeanAllows user to resize core pool size of the thread pool. Deprecated, use setCorePoolSize instead.- Specified by:
setCoreThreadsin interfaceJMXEnabledThreadPoolExecutorMBean
-
getMaximumThreads
@Deprecated public int getMaximumThreads()
Deprecated.Description copied from interface:JMXEnabledThreadPoolExecutorMBeanReturns maximum pool size of thread pool. Deprecated, use getMaximumThreads instead.- Specified by:
getMaximumThreadsin interfaceJMXEnabledThreadPoolExecutorMBean
-
setMaximumThreads
@Deprecated public void setMaximumThreads(int number)
Deprecated.Description copied from interface:JMXEnabledThreadPoolExecutorMBeanAllows user to resize maximum size of the thread pool. Deprecated, use setMaximumThreads instead.- Specified by:
setMaximumThreadsin interfaceJMXEnabledThreadPoolExecutorMBean
-
setMaximumPoolSize
public void setMaximumPoolSize(int newMaximumPoolSize)
Description copied from interface:ResizableThreadPoolAllows user to resize maximum size of the thread pool.- Specified by:
setMaximumPoolSizein interfaceResizableThreadPool- Overrides:
setMaximumPoolSizein classjava.util.concurrent.ThreadPoolExecutor
-
onInitialRejection
protected void onInitialRejection(java.lang.Runnable task)
- Overrides:
onInitialRejectionin classDebuggableThreadPoolExecutor
-
onFinalAccept
protected void onFinalAccept(java.lang.Runnable task)
- Overrides:
onFinalAcceptin classDebuggableThreadPoolExecutor
-
onFinalRejection
protected void onFinalRejection(java.lang.Runnable task)
- Overrides:
onFinalRejectionin classDebuggableThreadPoolExecutor
-
-