public class IgniteThreadPoolExecutor extends ThreadPoolExecutor
ExecutorService that executes submitted tasks using pooled grid threads.ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy| Modifier and Type | Field and Description |
|---|---|
static int |
DFLT_CORE_POOL_SIZE
Default core pool size (value is
100). |
| Constructor and Description |
|---|
IgniteThreadPoolExecutor()
Creates a new service with default initial parameters.
|
IgniteThreadPoolExecutor(int corePoolSize,
int maxPoolSize,
long keepAliveTime,
BlockingQueue<Runnable> workQueue)
Creates a new service with the given initial parameters.
|
IgniteThreadPoolExecutor(int corePoolSize,
int maxPoolSize,
long keepAliveTime,
BlockingQueue<Runnable> workQ,
RejectedExecutionHandler hnd)
Creates a new service with the given initial parameters.
|
IgniteThreadPoolExecutor(int corePoolSize,
int maxPoolSize,
long keepAliveTime,
BlockingQueue<Runnable> workQ,
ThreadFactory threadFactory,
RejectedExecutionHandler hnd)
Creates a new service with the given initial parameters.
|
IgniteThreadPoolExecutor(String gridName)
Creates a new service with default initial parameters.
|
IgniteThreadPoolExecutor(String threadNamePrefix,
String gridName,
int corePoolSize,
int maxPoolSize,
long keepAliveTime,
BlockingQueue<Runnable> workQ)
Creates a new service with the given initial parameters.
|
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, 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, toStringinvokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submitpublic static final int DFLT_CORE_POOL_SIZE
100).public IgniteThreadPoolExecutor()
| Name | Default Value |
|---|---|
| Core Pool Size | 100 (see DFLT_CORE_POOL_SIZE). |
| Maximum Pool Size | None, is it is not used for unbounded queues. |
| Keep alive time | No limit (see Long.MAX_VALUE). |
Blocking Queue (see BlockingQueue). |
Unbounded linked blocking queue (see LinkedBlockingDeque). |
public IgniteThreadPoolExecutor(int corePoolSize,
int maxPoolSize,
long keepAliveTime,
BlockingQueue<Runnable> workQueue)
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.workQueue - 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(int corePoolSize,
int maxPoolSize,
long keepAliveTime,
BlockingQueue<Runnable> workQ,
RejectedExecutionHandler hnd)
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.hnd - Optional handler to use when execution is blocked because the thread bounds and queue
capacities are reached. If null then AbortPolicy
handler is used by default.public IgniteThreadPoolExecutor(String gridName)
| Name | Default Value |
|---|---|
| Core Pool Size | 100 (see DFLT_CORE_POOL_SIZE). |
| Maximum Pool Size | None, is it is not used for unbounded queues. |
| Keep alive time | No limit (see Long.MAX_VALUE). |
Blocking Queue (see BlockingQueue). |
Unbounded linked blocking queue (see LinkedBlockingDeque). |
gridName - Name of the grid.public IgniteThreadPoolExecutor(String threadNamePrefix, String gridName, int corePoolSize, int maxPoolSize, long keepAliveTime, BlockingQueue<Runnable> workQ)
threadNamePrefix - Will be added at the beginning of all created threads.gridName - 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(int corePoolSize,
int maxPoolSize,
long keepAliveTime,
BlockingQueue<Runnable> workQ,
ThreadFactory threadFactory,
@Nullable
RejectedExecutionHandler hnd)
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.hnd - Optional handler to use when execution is blocked because the thread bounds and queue
capacities are reached. If null then AbortPolicy
handler is used by default.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.5.11 Release Date : April 8 2016