public class IgniteThreadPoolExecutor extends ThreadPoolExecutor implements org.apache.ignite.internal.processors.pool.MetricsAwareExecutorService
ExecutorService
that executes submitted tasks using pooled grid threads.ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
Modifier | Constructor and Description |
---|---|
|
IgniteThreadPoolExecutor(int corePoolSize,
int maxPoolSize,
long keepAliveTime,
BlockingQueue<Runnable> workQ,
ThreadFactory threadFactory)
Creates a new service with the given initial parameters.
|
protected |
IgniteThreadPoolExecutor(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.
|
Modifier and Type | Method and Description |
---|---|
protected void |
afterExecute(Runnable r,
Throwable t) |
protected void |
beforeExecute(Thread t,
Runnable r) |
protected void |
executionTimeMetric(org.apache.ignite.internal.processors.metric.impl.HistogramMetricImpl execTime) |
void |
registerMetrics(org.apache.ignite.internal.processors.metric.MetricRegistry mreg)
Register thread pool metrics.
|
allowCoreThreadTimeOut, 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
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
public IgniteThreadPoolExecutor(String threadNamePrefix, String igniteInstanceName, int corePoolSize, int maxPoolSize, long keepAliveTime, BlockingQueue<Runnable> workQ)
0
,
then the pool will degrade to a single-threaded pool.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.public IgniteThreadPoolExecutor(String threadNamePrefix, String igniteInstanceName, int corePoolSize, int maxPoolSize, long keepAliveTime, BlockingQueue<Runnable> workQ, byte plc, Thread.UncaughtExceptionHandler eHnd)
0
,
then the pool will degrade to a single-threaded pool.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
- GridIoPolicy
for thread pool.eHnd
- Uncaught exception handler for thread pool.public IgniteThreadPoolExecutor(int corePoolSize, int maxPoolSize, long keepAliveTime, BlockingQueue<Runnable> workQ, ThreadFactory threadFactory)
0
,
then the pool will degrade to a single-threaded pool.
*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.protected IgniteThreadPoolExecutor(int corePoolSize, int maxPoolSize, long keepAliveTime, BlockingQueue<Runnable> workQ, ThreadFactory threadFactory, @Nullable @Nullable org.apache.ignite.internal.processors.metric.impl.HistogramMetricImpl execTime)
0
,
then the pool will degrade to a single-threaded pool.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.protected void beforeExecute(Thread t, Runnable r)
beforeExecute
in class ThreadPoolExecutor
protected void afterExecute(Runnable r, Throwable t)
afterExecute
in class ThreadPoolExecutor
public void registerMetrics(org.apache.ignite.internal.processors.metric.MetricRegistry mreg)
registerMetrics
in interface org.apache.ignite.internal.processors.pool.MetricsAwareExecutorService
mreg
- Metrics registry.protected void executionTimeMetric(org.apache.ignite.internal.processors.metric.impl.HistogramMetricImpl execTime)
execTime
- Task execution time metric.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.16.0 Release Date : December 15 2023