Package org.apache.ignite.thread
Class IgniteThreadPoolExecutor
- java.lang.Object
- 
- java.util.concurrent.AbstractExecutorService
- 
- java.util.concurrent.ThreadPoolExecutor
- 
- org.apache.ignite.thread.IgniteThreadPoolExecutor
 
 
 
- 
- All Implemented Interfaces:
- Executor,- ExecutorService,- org.apache.ignite.internal.processors.pool.MetricsAwareExecutorService
 
 public class IgniteThreadPoolExecutor extends ThreadPoolExecutor implements org.apache.ignite.internal.processors.pool.MetricsAwareExecutorService AnExecutorServicethat executes submitted tasks using pooled grid threads.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutorThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description IgniteThreadPoolExecutor(int corePoolSize, int maxPoolSize, long keepAliveTime, BlockingQueue<Runnable> workQ, ThreadFactory threadFactory)Creates a new service with the given initial parameters.protectedIgniteThreadPoolExecutor(int corePoolSize, int maxPoolSize, long keepAliveTime, BlockingQueue<Runnable> workQ, ThreadFactory threadFactory, @Nullable org.apache.ignite.internal.processors.metric.impl.HistogramMetricImpl execTime)Creates a new service with the given initial parameters.IgniteThreadPoolExecutor(String threadNamePrefix, String igniteInstanceName, int corePoolSize, int maxPoolSize, long keepAliveTime, BlockingQueue<Runnable> workQ)Creates a new service with the given initial parameters.IgniteThreadPoolExecutor(String threadNamePrefix, String igniteInstanceName, int corePoolSize, int maxPoolSize, long keepAliveTime, BlockingQueue<Runnable> workQ, byte plc, Thread.UncaughtExceptionHandler eHnd)Creates a new service with the given initial parameters.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafterExecute(Runnable r, Throwable t)protected voidbeforeExecute(Thread t, Runnable r)protected voidexecutionTimeMetric(org.apache.ignite.internal.processors.metric.impl.HistogramMetricImpl execTime)voidregisterMetrics(org.apache.ignite.internal.processors.metric.MetricRegistryImpl mreg)Register thread pool metrics.- 
Methods inherited from class java.util.concurrent.ThreadPoolExecutorallowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated, toString
 - 
Methods inherited from class java.util.concurrent.AbstractExecutorServiceinvokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
 
- 
 
- 
- 
- 
Constructor Detail- 
IgniteThreadPoolExecutorpublic IgniteThreadPoolExecutor(String threadNamePrefix, String igniteInstanceName, int corePoolSize, int maxPoolSize, long keepAliveTime, BlockingQueue<Runnable> workQ) Creates a new service with the given initial parameters. NOTE: There is a known bug. If 'corePoolSize' equals0, then the pool will degrade to a single-threaded pool.- Parameters:
- threadNamePrefix- Will be added at the beginning of all created threads.
- igniteInstanceName- Must be the name of the grid.
- corePoolSize- The number of threads to keep in the pool, even if they are idle.
- maxPoolSize- The maximum number of threads to allow in the pool.
- keepAliveTime- When the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.
- workQ- The queue to use for holding tasks before they are executed. This queue will hold only runnable tasks submitted by the- ThreadPoolExecutor.execute(Runnable)method.
 
 - 
IgniteThreadPoolExecutorpublic IgniteThreadPoolExecutor(String threadNamePrefix, String igniteInstanceName, int corePoolSize, int maxPoolSize, long keepAliveTime, BlockingQueue<Runnable> workQ, byte plc, Thread.UncaughtExceptionHandler eHnd) Creates a new service with the given initial parameters. NOTE: There is a known bug. If 'corePoolSize' equals0, then the pool will degrade to a single-threaded pool.- Parameters:
- threadNamePrefix- Will be added at the beginning of all created threads.
- igniteInstanceName- Must be the name of the grid.
- corePoolSize- The number of threads to keep in the pool, even if they are idle.
- maxPoolSize- The maximum number of threads to allow in the pool.
- keepAliveTime- When the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.
- workQ- The queue to use for holding tasks before they are executed. This queue will hold only runnable tasks submitted by the- ThreadPoolExecutor.execute(Runnable)method.
- plc-- GridIoPolicyfor thread pool.
- eHnd- Uncaught exception handler for thread pool.
 
 - 
IgniteThreadPoolExecutorpublic IgniteThreadPoolExecutor(int corePoolSize, int maxPoolSize, long keepAliveTime, BlockingQueue<Runnable> workQ, ThreadFactory threadFactory)Creates a new service with the given initial parameters. NOTE: There is a known bug. If 'corePoolSize' equals0, then the pool will degrade to a single-threaded pool. *- Parameters:
- corePoolSize- The number of threads to keep in the pool, even if they are idle.
- maxPoolSize- The maximum number of threads to allow in the pool.
- keepAliveTime- When the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.
- workQ- The queue to use for holding tasks before they are executed. This queue will hold only the runnable tasks submitted by the- ThreadPoolExecutor.execute(Runnable)method.
- threadFactory- Thread factory.
 
 - 
IgniteThreadPoolExecutorprotected IgniteThreadPoolExecutor(int corePoolSize, int maxPoolSize, long keepAliveTime, BlockingQueue<Runnable> workQ, ThreadFactory threadFactory, @Nullable @Nullable org.apache.ignite.internal.processors.metric.impl.HistogramMetricImpl execTime)Creates a new service with the given initial parameters. NOTE: There is a known bug. If 'corePoolSize' equals0, then the pool will degrade to a single-threaded pool.- Parameters:
- corePoolSize- The number of threads to keep in the pool, even if they are idle.
- maxPoolSize- The maximum number of threads to allow in the pool.
- keepAliveTime- When the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.
- workQ- The queue to use for holding tasks before they are executed. This queue will hold only the runnable tasks submitted by the- ThreadPoolExecutor.execute(Runnable)method.
- threadFactory- Thread factory.
- execTime- Task execution time metric.
 
 
- 
 - 
Method Detail- 
beforeExecuteprotected void beforeExecute(Thread t, Runnable r) - Overrides:
- beforeExecutein class- ThreadPoolExecutor
 
 - 
afterExecuteprotected void afterExecute(Runnable r, Throwable t) - Overrides:
- afterExecutein class- ThreadPoolExecutor
 
 - 
registerMetricspublic void registerMetrics(org.apache.ignite.internal.processors.metric.MetricRegistryImpl mreg) Register thread pool metrics.- Specified by:
- registerMetricsin interface- org.apache.ignite.internal.processors.pool.MetricsAwareExecutorService
- Parameters:
- mreg- Metrics registry.
 
 - 
executionTimeMetricprotected void executionTimeMetric(org.apache.ignite.internal.processors.metric.impl.HistogramMetricImpl execTime) - Parameters:
- execTime- Task execution time metric.
 
 
- 
 
-