bharatviswa504 commented on a change in pull request #714: HDDS-1406. Avoid
usage of commonPool in RatisPipelineUtils.
URL: https://github.com/apache/hadoop/pull/714#discussion_r274539471
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/RatisPipelineUtils.java
##########
@@ -51,6 +52,15 @@
private static final Logger LOG =
LoggerFactory.getLogger(RatisPipelineUtils.class);
+ // Set parallelism at 3, as now in Ratis we create 1 and 3 node pipelines.
+ private static int parallelismForPool =
+ (Runtime.getRuntime().availableProcessors() > 3) ? 3 :
+ Runtime.getRuntime().availableProcessors();
+
+ private static ForkJoinPool pool = new ForkJoinPool(parallelismForPool);
Review comment:
Used ForkJoinPool can be used for normal tasks also. Refer NonFrok Join
Clients.
https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ForkJoinPool.html
Used this ForJoinPool here to take advantage of its WorkSteal Algorithm in
allocating/claiming threads. I think this might be useful. More can be read
from the documentation.
And if no of available processors is less than 3, even setting to 3 will not
have any advantage. This is the reason for setting this.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]