Class IoTDBThreadPoolFactory
- java.lang.Object
-
- org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory
-
public class IoTDBThreadPoolFactory extends java.lang.ObjectThis class is used to create thread pool which must contain the pool name. Notice that IoTDB project does not allow creating ThreadPool using Executors.newXXX() function to get a threadpool because it is hard to be traced.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.concurrent.ExecutorServicecreateThriftRpcClientThreadPool(int minWorkerThreads, int maxWorkerThreads, int stopTimeoutVal, java.util.concurrent.TimeUnit stopTimeoutUnit, java.lang.String poolName)function for creating thrift rpc client thread pool.static java.util.concurrent.ExecutorServicecreateThriftRpcClientThreadPool(org.apache.thrift.server.TThreadPoolServer.Args args, java.lang.String poolName)function for creating thrift rpc client thread pool.static java.util.concurrent.ExecutorServicecreateThriftRpcClientThreadPool(org.apache.thrift.server.TThreadPoolServer.Args args, java.lang.String poolName, java.lang.Thread.UncaughtExceptionHandler handler)function for creating thrift rpc client thread pool.static java.util.concurrent.ExecutorServicenewCachedThreadPool(java.lang.String poolName)seeExecutors.newCachedThreadPool(java.util.concurrent.ThreadFactory).static java.util.concurrent.ExecutorServicenewCachedThreadPool(java.lang.String poolName, int maximumPoolSize)static java.util.concurrent.ExecutorServicenewCachedThreadPool(java.lang.String poolName, java.lang.Thread.UncaughtExceptionHandler handler)static java.util.concurrent.ExecutorServicenewCachedThreadPoolWithDaemon(java.lang.String poolName)static java.util.concurrent.ExecutorServicenewFixedThreadPool(int nThreads, java.lang.String poolName)seeExecutors.newFixedThreadPool(int, java.util.concurrent.ThreadFactory).static java.util.concurrent.ExecutorServicenewFixedThreadPool(int nThreads, java.lang.String poolName, java.lang.Thread.UncaughtExceptionHandler handler)static java.util.concurrent.ExecutorServicenewFixedThreadPoolWithDaemonThread(int nThreads, java.lang.String poolName)static java.util.concurrent.ScheduledExecutorServicenewScheduledThreadPool(int corePoolSize, java.lang.String poolName)seeExecutors.newScheduledThreadPool(int, java.util.concurrent.ThreadFactory).static java.util.concurrent.ScheduledExecutorServicenewScheduledThreadPool(int corePoolSize, java.lang.String poolName, java.lang.Thread.UncaughtExceptionHandler handler)static java.util.concurrent.ScheduledExecutorServicenewScheduledThreadPoolWithDaemon(int corePoolSize, java.lang.String poolName)static java.util.concurrent.ExecutorServicenewSingleThreadExecutor(java.lang.String poolName)seeExecutors.newSingleThreadExecutor(java.util.concurrent.ThreadFactory).static java.util.concurrent.ExecutorServicenewSingleThreadExecutor(java.lang.String poolName, java.lang.Thread.UncaughtExceptionHandler handler)static java.util.concurrent.ExecutorServicenewSingleThreadExecutorWithDaemon(java.lang.String poolName)static java.util.concurrent.ScheduledExecutorServicenewSingleThreadScheduledExecutor(java.lang.String poolName)seeExecutors.newSingleThreadExecutor(java.util.concurrent.ThreadFactory).static java.util.concurrent.ScheduledExecutorServicenewSingleThreadScheduledExecutor(java.lang.String poolName, java.lang.Thread.UncaughtExceptionHandler handler)static java.util.concurrent.ExecutorServicenewThreadPool(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, IoTThreadFactory ioTThreadFactory, java.lang.String poolName)
-
-
-
Method Detail
-
newFixedThreadPool
public static java.util.concurrent.ExecutorService newFixedThreadPool(int nThreads, java.lang.String poolName)seeExecutors.newFixedThreadPool(int, java.util.concurrent.ThreadFactory).- Parameters:
poolName- - the name of thread pool- Returns:
- fixed size thread pool
-
newFixedThreadPoolWithDaemonThread
public static java.util.concurrent.ExecutorService newFixedThreadPoolWithDaemonThread(int nThreads, java.lang.String poolName)
-
newFixedThreadPool
public static java.util.concurrent.ExecutorService newFixedThreadPool(int nThreads, java.lang.String poolName, java.lang.Thread.UncaughtExceptionHandler handler)
-
newSingleThreadExecutor
public static java.util.concurrent.ExecutorService newSingleThreadExecutor(java.lang.String poolName)
seeExecutors.newSingleThreadExecutor(java.util.concurrent.ThreadFactory).- Parameters:
poolName- the name of thread pool.- Returns:
- thread pool.
-
newSingleThreadExecutorWithDaemon
public static java.util.concurrent.ExecutorService newSingleThreadExecutorWithDaemon(java.lang.String poolName)
-
newSingleThreadExecutor
public static java.util.concurrent.ExecutorService newSingleThreadExecutor(java.lang.String poolName, java.lang.Thread.UncaughtExceptionHandler handler)
-
newCachedThreadPool
public static java.util.concurrent.ExecutorService newCachedThreadPool(java.lang.String poolName)
seeExecutors.newCachedThreadPool(java.util.concurrent.ThreadFactory).- Parameters:
poolName- the name of thread pool.- Returns:
- thread pool.
-
newCachedThreadPool
public static java.util.concurrent.ExecutorService newCachedThreadPool(java.lang.String poolName, int maximumPoolSize)
-
newCachedThreadPool
public static java.util.concurrent.ExecutorService newCachedThreadPool(java.lang.String poolName, java.lang.Thread.UncaughtExceptionHandler handler)
-
newCachedThreadPoolWithDaemon
public static java.util.concurrent.ExecutorService newCachedThreadPoolWithDaemon(java.lang.String poolName)
-
newSingleThreadScheduledExecutor
public static java.util.concurrent.ScheduledExecutorService newSingleThreadScheduledExecutor(java.lang.String poolName)
seeExecutors.newSingleThreadExecutor(java.util.concurrent.ThreadFactory).- Parameters:
poolName- the name of thread pool.- Returns:
- scheduled thread pool.
-
newSingleThreadScheduledExecutor
public static java.util.concurrent.ScheduledExecutorService newSingleThreadScheduledExecutor(java.lang.String poolName, java.lang.Thread.UncaughtExceptionHandler handler)
-
newScheduledThreadPool
public static java.util.concurrent.ScheduledExecutorService newScheduledThreadPool(int corePoolSize, java.lang.String poolName)seeExecutors.newScheduledThreadPool(int, java.util.concurrent.ThreadFactory).- Parameters:
corePoolSize- the number of threads to keep in the pool.poolName- the name of thread pool.- Returns:
- thread pool.
-
newScheduledThreadPoolWithDaemon
public static java.util.concurrent.ScheduledExecutorService newScheduledThreadPoolWithDaemon(int corePoolSize, java.lang.String poolName)
-
newScheduledThreadPool
public static java.util.concurrent.ScheduledExecutorService newScheduledThreadPool(int corePoolSize, java.lang.String poolName, java.lang.Thread.UncaughtExceptionHandler handler)
-
newThreadPool
public static java.util.concurrent.ExecutorService newThreadPool(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, IoTThreadFactory ioTThreadFactory, java.lang.String poolName)
-
createThriftRpcClientThreadPool
public static java.util.concurrent.ExecutorService createThriftRpcClientThreadPool(org.apache.thrift.server.TThreadPoolServer.Args args, java.lang.String poolName)function for creating thrift rpc client thread pool.
-
createThriftRpcClientThreadPool
public static java.util.concurrent.ExecutorService createThriftRpcClientThreadPool(int minWorkerThreads, int maxWorkerThreads, int stopTimeoutVal, java.util.concurrent.TimeUnit stopTimeoutUnit, java.lang.String poolName)function for creating thrift rpc client thread pool.
-
createThriftRpcClientThreadPool
public static java.util.concurrent.ExecutorService createThriftRpcClientThreadPool(org.apache.thrift.server.TThreadPoolServer.Args args, java.lang.String poolName, java.lang.Thread.UncaughtExceptionHandler handler)function for creating thrift rpc client thread pool.
-
-