You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2020/04/16 06:03:08 UTC
[incubator-iotdb] branch disable_mqtt_server updated: fix compiler
error
This is an automated email from the ASF dual-hosted git repository.
hxd pushed a commit to branch disable_mqtt_server
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/disable_mqtt_server by this push:
new f06c946 fix compiler error
f06c946 is described below
commit f06c9469a59f78f21d29e6679fd1f3684a9042f6
Author: xiangdong huang <sa...@gmail.com>
AuthorDate: Thu Apr 16 14:02:08 2020 +0800
fix compiler error
---
.../iotdb/db/concurrent/IoTDBThreadPoolFactory.java | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/server/src/main/java/org/apache/iotdb/db/concurrent/IoTDBThreadPoolFactory.java b/server/src/main/java/org/apache/iotdb/db/concurrent/IoTDBThreadPoolFactory.java
index 991bd63..3de7802 100644
--- a/server/src/main/java/org/apache/iotdb/db/concurrent/IoTDBThreadPoolFactory.java
+++ b/server/src/main/java/org/apache/iotdb/db/concurrent/IoTDBThreadPoolFactory.java
@@ -24,6 +24,7 @@ import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadPoolExecutor;
import org.apache.thrift.server.CustomizedTThreadPoolServer;
+import org.apache.thrift.server.TThreadPoolServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -137,4 +138,23 @@ public class IoTDBThreadPoolFactory {
args.stopTimeoutUnit, executorQueue, new IoTThreadFactory(poolName, handler));
}
+ /**
+ * function for creating thrift rpc client thread pool.
+ */
+ public static ExecutorService createThriftRpcClientThreadPool(TThreadPoolServer.Args args, String poolName) {
+ SynchronousQueue<Runnable> executorQueue = new SynchronousQueue<>();
+ return new ThreadPoolExecutor(args.minWorkerThreads, args.maxWorkerThreads, args.stopTimeoutVal,
+ args.stopTimeoutUnit, executorQueue, new IoTThreadFactory(poolName));
+ }
+
+ /**
+ * function for creating thrift rpc client thread pool.
+ */
+ public static ExecutorService createThriftRpcClientThreadPool(TThreadPoolServer.Args args, String poolName,
+ Thread.UncaughtExceptionHandler handler) {
+ SynchronousQueue<Runnable> executorQueue = new SynchronousQueue<>();
+ return new ThreadPoolExecutor(args.minWorkerThreads, args.maxWorkerThreads, args.stopTimeoutVal,
+ args.stopTimeoutUnit, executorQueue, new IoTThreadFactory(poolName, handler));
+ }
+
}