mcvsubbu 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_r341397686
##########
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:
while this math seems correct to me, let us avoid making changes unrelated
to the PR.
----------------------------------------------------------------
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]