This is an automated email from the ASF dual-hosted git repository.
JackieTien97 pushed a commit to branch worktree-rpc-thread-opt
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/worktree-rpc-thread-opt by
this push:
new 137ac09fe7f Allow Coordinator to pass DataNode-specific selectorNum to
async client pool
137ac09fe7f is described below
commit 137ac09fe7f878173902574546c5fa301b0e2aab
Author: JackieTien97 <[email protected]>
AuthorDate: Mon Apr 27 10:07:20 2026 +0800
Allow Coordinator to pass DataNode-specific selectorNum to async client pool
Add a parameterized constructor to
AsyncDataNodeInternalServiceClientPoolFactory
so that callers can override the selector thread count. The no-arg
constructor
still defaults to CommonConfig.getSelectorNumOfClientManager(). Coordinator
now
passes IoTDBConfig.getSelectorNumOfClientManager() to use the
DataNode-specific
value.
---
.../org/apache/iotdb/db/queryengine/plan/Coordinator.java | 3 ++-
.../org/apache/iotdb/commons/client/ClientPoolFactory.java | 12 +++++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/Coordinator.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/Coordinator.java
index 6e04e5918d7..beed70815a0 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/Coordinator.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/Coordinator.java
@@ -216,7 +216,8 @@ public class Coordinator {
ASYNC_INTERNAL_SERVICE_CLIENT_MANAGER =
new IClientManager.Factory<TEndPoint,
AsyncDataNodeInternalServiceClient>()
.createClientManager(
- new
ClientPoolFactory.AsyncDataNodeInternalServiceClientPoolFactory());
+ new
ClientPoolFactory.AsyncDataNodeInternalServiceClientPoolFactory(
+ CONFIG.getSelectorNumOfClientManager()));
private final ExecutorService executor;
private final ScheduledExecutorService scheduledExecutor;
diff --git
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ClientPoolFactory.java
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ClientPoolFactory.java
index a5a6dd3808e..524edaf5b7e 100644
---
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ClientPoolFactory.java
+++
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ClientPoolFactory.java
@@ -120,6 +120,16 @@ public class ClientPoolFactory {
public static class AsyncDataNodeInternalServiceClientPoolFactory
implements IClientPoolFactory<TEndPoint,
AsyncDataNodeInternalServiceClient> {
+ private final int selectorNumOfAsyncClientManager;
+
+ public AsyncDataNodeInternalServiceClientPoolFactory() {
+ this.selectorNumOfAsyncClientManager =
conf.getSelectorNumOfClientManager();
+ }
+
+ public AsyncDataNodeInternalServiceClientPoolFactory(int
selectorNumOfAsyncClientManager) {
+ this.selectorNumOfAsyncClientManager = selectorNumOfAsyncClientManager;
+ }
+
@Override
public GenericKeyedObjectPool<TEndPoint,
AsyncDataNodeInternalServiceClient> createClientPool(
ClientManager<TEndPoint, AsyncDataNodeInternalServiceClient> manager) {
@@ -130,7 +140,7 @@ public class ClientPoolFactory {
new ThriftClientProperty.Builder()
.setConnectionTimeoutMs(conf.getDnConnectionTimeoutInMS())
.setRpcThriftCompressionEnabled(conf.isRpcThriftCompressionEnabled())
-
.setSelectorNumOfAsyncClientManager(conf.getSelectorNumOfClientManager())
+
.setSelectorNumOfAsyncClientManager(selectorNumOfAsyncClientManager)
.setPrintLogWhenEncounterException(false)
.build(),
ThreadName.ASYNC_DATANODE_CLIENT_POOL.getName()),