GridGain™ 4.3.1e
Enterprise "Big Data" Edition

org.gridgain.grid.thread
Class GridThreadPoolExecutor

java.lang.Object
  extended by java.util.concurrent.AbstractExecutorService
      extended by java.util.concurrent.ThreadPoolExecutor
          extended by org.gridgain.grid.thread.GridThreadPoolExecutor
All Implemented Interfaces:
Executor, ExecutorService

public class GridThreadPoolExecutor
extends ThreadPoolExecutor

An ExecutorService that executes submitted tasks using pooled grid threads.

 

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
 
Field Summary
static int DFLT_CORE_POOL_SIZE
          Default core pool size (value is 100).
 
Constructor Summary
GridThreadPoolExecutor()
          Creates a new service with default initial parameters.
GridThreadPoolExecutor(int corePoolSize, int maxPoolSize, long keepAliveTime, BlockingQueue<Runnable> workQueue)
          Creates a new service with the given initial parameters.
GridThreadPoolExecutor(int corePoolSize, int maxPoolSize, long keepAliveTime, BlockingQueue<Runnable> workQ, RejectedExecutionHandler hnd)
          Creates a new service with the given initial parameters.
GridThreadPoolExecutor(int corePoolSize, int maxPoolSize, long keepAliveTime, BlockingQueue<Runnable> workQ, ThreadFactory threadFactory, RejectedExecutionHandler hnd)
          Creates a new service with the given initial parameters.
GridThreadPoolExecutor(String gridName)
          Creates a new service with default initial parameters.
GridThreadPoolExecutor(String gridName, int corePoolSize, int maxPoolSize, long keepAliveTime, BlockingQueue<Runnable> workQ)
          Creates a new service with the given initial parameters.
GridThreadPoolExecutor(String gridName, int corePoolSize, int maxPoolSize, long keepAliveTime, BlockingQueue<Runnable> workQ, RejectedExecutionHandler hnd)
          Creates a new service with the given initial parameters.
 
Method Summary
 
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
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
 
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DFLT_CORE_POOL_SIZE

public static final int DFLT_CORE_POOL_SIZE
Default core pool size (value is 100).

See Also:
Constant Field Values
Constructor Detail

GridThreadPoolExecutor

public GridThreadPoolExecutor()
Creates a new service with default initial parameters. Default values are:
Name Default Value
Core Pool Size 100 (see GridThreadPoolExecutor.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).


GridThreadPoolExecutor

public GridThreadPoolExecutor(int corePoolSize,
                              int maxPoolSize,
                              long keepAliveTime,
                              BlockingQueue<Runnable> workQueue)
Creates a new service with the given initial parameters.

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.
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.

GridThreadPoolExecutor

public GridThreadPoolExecutor(int corePoolSize,
                              int maxPoolSize,
                              long keepAliveTime,
                              BlockingQueue<Runnable> workQ,
                              RejectedExecutionHandler hnd)
Creates a new service with the given initial parameters.

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.
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.

GridThreadPoolExecutor

public GridThreadPoolExecutor(String gridName)
Creates a new service with default initial parameters. Default values are:
Name Default Value
Core Pool Size 100 (see GridThreadPoolExecutor.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).

Parameters:
gridName - Name of the grid.

GridThreadPoolExecutor

public GridThreadPoolExecutor(String gridName,
                              int corePoolSize,
                              int maxPoolSize,
                              long keepAliveTime,
                              BlockingQueue<Runnable> workQ)
Creates a new service with the given initial parameters.

Parameters:
gridName - 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.

GridThreadPoolExecutor

public GridThreadPoolExecutor(String gridName,
                              int corePoolSize,
                              int maxPoolSize,
                              long keepAliveTime,
                              BlockingQueue<Runnable> workQ,
                              RejectedExecutionHandler hnd)
Creates a new service with the given initial parameters.

Parameters:
gridName - 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 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.

GridThreadPoolExecutor

public GridThreadPoolExecutor(int corePoolSize,
                              int maxPoolSize,
                              long keepAliveTime,
                              BlockingQueue<Runnable> workQ,
                              ThreadFactory threadFactory,
                              @Nullable
                              RejectedExecutionHandler hnd)
Creates a new service with the given initial parameters.

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.
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.

GridGain™ 4.3.1e
Enterprise "Big Data" Edition

GridGain - In-Memory Big Data
Enterprise "Big Data" Edition, ver. 4.3.1e.10112012
2012 Copyright © GridGain Systems
Follow us:   Follow GridGain on Github Join GridGain User Group Follow GridGain on Twitter Follow GridGain on Vimeo