You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2019/10/31 22:58:51 UTC

[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #4764: Fix the bug of releasing the segment when there are still threads working on it

Jackie-Jiang commented on a change in pull request #4764: Fix the bug of releasing the segment when there are still threads working on it
URL: https://github.com/apache/incubator-pinot/pull/4764#discussion_r341398855
 
 

 ##########
 File path: pinot-core/src/main/java/org/apache/pinot/core/plan/CombinePlanNode.java
 ##########
 @@ -92,27 +94,42 @@ public Operator run() {
       // Calculate the time out timestamp
       long endTime = System.currentTimeMillis() + TIME_OUT_IN_MILLISECONDS_FOR_PARALLEL_RUN;
 
-      int threads = Math.min(numPlanNodes / MIN_TASKS_PER_THREAD + ((numPlanNodes % MIN_TASKS_PER_THREAD == 0) ? 0 : 1),
-          // ceil without using double arithmetic
-          MAX_PLAN_THREADS);
-      int opsPerThread = Math.max(numPlanNodes / threads + ((numPlanNodes % threads == 0) ? 0 : 1),
-          // ceil without using double arithmetic
-          MIN_TASKS_PER_THREAD);
+      int numThreads = Math.min((numPlanNodes + NUM_PLANS_PER_THREAD - 1) / NUM_PLANS_PER_THREAD, MAX_PLAN_THREADS);
 
 Review comment:
   Sure, will make another PR for the math change

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org