[ 
https://issues.apache.org/jira/browse/HDDS-1406?focusedWorklogId=226183&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-226183
 ]

ASF GitHub Bot logged work on HDDS-1406:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 11/Apr/19 17:18
            Start Date: 11/Apr/19 17:18
    Worklog Time Spent: 10m 
      Work Description: bharatviswa504 commented on 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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 226183)
    Time Spent: 1h  (was: 50m)

> Avoid usage of commonPool in RatisPipelineUtils
> -----------------------------------------------
>
>                 Key: HDDS-1406
>                 URL: https://issues.apache.org/jira/browse/HDDS-1406
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>            Reporter: Bharat Viswanadham
>            Assignee: Bharat Viswanadham
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> We use parallelStream in during createPipline, this internally uses 
> commonPool. Use Our own ForkJoinPool with parallelisim set with number of 
> processors.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to