You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ji...@apache.org on 2020/08/27 13:09:10 UTC
[incubator-iotdb] branch cluster_receiver_wait updated: add thread
name
This is an automated email from the ASF dual-hosted git repository.
jiangtian pushed a commit to branch cluster_receiver_wait
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/cluster_receiver_wait by this push:
new a6e4ffa add thread name
a6e4ffa is described below
commit a6e4ffa10001dfc6ba1b8d97a625c5a460f3967c
Author: jt2594838 <jt...@163.com>
AuthorDate: Thu Aug 27 21:08:28 2020 +0800
add thread name
---
.../java/org/apache/iotdb/cluster/server/member/RaftMember.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/server/member/RaftMember.java b/cluster/src/main/java/org/apache/iotdb/cluster/server/member/RaftMember.java
index 8f976fb..35cb042 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/server/member/RaftMember.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/server/member/RaftMember.java
@@ -19,6 +19,7 @@
package org.apache.iotdb.cluster.server.member;
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
@@ -214,8 +215,11 @@ public abstract class RaftMember {
heartBeatService =
Executors.newSingleThreadScheduledExecutor(r -> new Thread(r,
name + "-HeartbeatThread@" + System.currentTimeMillis()));
- catchUpService = Executors.newCachedThreadPool();
- appendLogThreadPool = Executors.newCachedThreadPool();
+ catchUpService =
+ Executors.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat(getName() +
+ "-CatchUpThread%d").build());
+ appendLogThreadPool = Executors.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat(getName() +
+ "-AppendLog%d").build());
asyncThreadPool = new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors(), 100,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<>());