Class IoTDBThreadPoolFactory


  • public class IoTDBThreadPoolFactory
    extends java.lang.Object
    This 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.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.
      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.
      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.
      static java.util.concurrent.ExecutorService newCachedThreadPool​(java.lang.String poolName)
      see Executors.newCachedThreadPool(java.util.concurrent.ThreadFactory).
      static java.util.concurrent.ExecutorService newCachedThreadPool​(java.lang.String poolName, int maximumPoolSize)  
      static java.util.concurrent.ExecutorService newCachedThreadPool​(java.lang.String poolName, java.lang.Thread.UncaughtExceptionHandler handler)  
      static java.util.concurrent.ExecutorService newCachedThreadPoolWithDaemon​(java.lang.String poolName)  
      static java.util.concurrent.ExecutorService newFixedThreadPool​(int nThreads, java.lang.String poolName)
      see Executors.newFixedThreadPool(int, java.util.concurrent.ThreadFactory).
      static java.util.concurrent.ExecutorService newFixedThreadPool​(int nThreads, java.lang.String poolName, java.lang.Thread.UncaughtExceptionHandler handler)  
      static java.util.concurrent.ExecutorService newFixedThreadPoolWithDaemonThread​(int nThreads, java.lang.String poolName)  
      static java.util.concurrent.ScheduledExecutorService newScheduledThreadPool​(int corePoolSize, java.lang.String poolName)
      see Executors.newScheduledThreadPool(int, java.util.concurrent.ThreadFactory).
      static java.util.concurrent.ScheduledExecutorService newScheduledThreadPool​(int corePoolSize, java.lang.String poolName, java.lang.Thread.UncaughtExceptionHandler handler)  
      static java.util.concurrent.ScheduledExecutorService newScheduledThreadPoolWithDaemon​(int corePoolSize, java.lang.String poolName)  
      static java.util.concurrent.ExecutorService newSingleThreadExecutor​(java.lang.String poolName)
      see Executors.newSingleThreadExecutor(java.util.concurrent.ThreadFactory).
      static java.util.concurrent.ExecutorService newSingleThreadExecutor​(java.lang.String poolName, java.lang.Thread.UncaughtExceptionHandler handler)  
      static java.util.concurrent.ExecutorService newSingleThreadExecutorWithDaemon​(java.lang.String poolName)  
      static java.util.concurrent.ScheduledExecutorService newSingleThreadScheduledExecutor​(java.lang.String poolName)
      see Executors.newSingleThreadExecutor(java.util.concurrent.ThreadFactory).
      static java.util.concurrent.ScheduledExecutorService newSingleThreadScheduledExecutor​(java.lang.String poolName, java.lang.Thread.UncaughtExceptionHandler handler)  
      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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • newFixedThreadPool

        public static java.util.concurrent.ExecutorService newFixedThreadPool​(int nThreads,
                                                                              java.lang.String poolName)
        see Executors.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)
        see Executors.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)
        see Executors.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)
        see Executors.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)
        see Executors.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.