lokeshj1703 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_r278896085
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/RatisPipelineUtils.java
##########
@@ -41,16 +41,35 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ForkJoinPool;
+import java.util.concurrent.ForkJoinWorkerThread;
+import java.util.concurrent.RejectedExecutionException;
/**
* Utility class for Ratis pipelines. Contains methods to create and destroy
* ratis pipelines.
*/
-final class RatisPipelineUtils {
+public final class RatisPipelineUtils {
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 final int PARALLELISIM_FOR_POOL = 3;
+
+ private static final ForkJoinPool.ForkJoinWorkerThreadFactory FACTORY =
Review comment:
Can we avoid making it static? The problem with static occurs in the
MiniOzoneCluster tests. Once SCM is stopped by one of the tests, the fork join
pool will be shutdown and will not be available again for execution. I think
this might be a reason for unit test failures.
----------------------------------------------------------------
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]