You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by GitBox <gi...@apache.org> on 2021/12/16 05:30:00 UTC

[GitHub] [ratis] szetszwo commented on a change in pull request #566: RATIS-1472. make use CachedThreadPool configurable.

szetszwo commented on a change in pull request #566:
URL: https://github.com/apache/ratis/pull/566#discussion_r770234663



##########
File path: ratis-netty/src/main/java/org/apache/ratis/netty/server/DataStreamManagement.java
##########
@@ -212,18 +213,28 @@ StreamInfo remove(ClientInvocationId key) {
   private final StreamMap streams = new StreamMap();
   private final Executor requestExecutor;
   private final Executor writeExecutor;
+  private final Boolean useCachedThreadPool;
 
   DataStreamManagement(RaftServer server) {
     this.server = server;
     this.name = server.getId() + "-" + JavaUtils.getClassSimpleName(getClass());
 
     final RaftProperties properties = server.getProperties();
-    this.requestExecutor = ConcurrentUtils.newCachedThreadPool(
-        RaftServerConfigKeys.DataStream.asyncRequestThreadPoolSize(properties),
-        ConcurrentUtils.newThreadFactory(name + "-request-"));
-    this.writeExecutor = ConcurrentUtils.newCachedThreadPool(
-        RaftServerConfigKeys.DataStream.asyncWriteThreadPoolSize(properties),
-        ConcurrentUtils.newThreadFactory(name + "-write-"));
+    this.useCachedThreadPool = RaftServerConfigKeys.DataStream.useCachedThreadPool(properties);

Review comment:
       Let's just make it a local variable.

##########
File path: ratis-server-api/src/main/java/org/apache/ratis/server/RaftServerConfigKeys.java
##########
@@ -457,6 +457,18 @@ static void setRetentionFileNum(RaftProperties properties, int numSnapshotFilesR
   interface DataStream {
     String PREFIX = RaftServerConfigKeys.PREFIX + ".data-stream";
 
+    String USE_CACHED_THREAD_POOL_KEY = PREFIX + ".use.cached.thread.pool";

Review comment:
       Let's change it to ".async.request.thread.pool.cached".  Then, it is easy to see that this conf and ".async.request.thread.pool.size" are closely related.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org