AmatyaAvadhanula commented on code in PR #14584:
URL: https://github.com/apache/druid/pull/14584#discussion_r1295467954


##########
server/src/main/java/org/apache/druid/server/coordinator/loading/SegmentLoadingConfig.java:
##########
@@ -136,8 +121,35 @@ public int getMaxReplicaAssignmentsInRun()
     return maxReplicaAssignmentsInRun;
   }
 
-  public int getPercentDecommSegmentsToMove()
+  public int getBalancerComputeThreads()
   {
-    return percentDecommSegmentsToMove;
+    return balancerComputeThreads;
+  }
+
+  /**
+   * Computes the number of threads to be used in the balancing executor.
+   * The number of used segments in a cluster is generally a good indicator of
+   * the cluster size and has been used here as a proxy for the actual number 
of
+   * segments that would be involved in cost computations.
+   * <p>
+   * The number of threads increases by 1 first for every 50k segments, then 
for
+   * every 75k segments and so on.
+   *
+   * @return Number of {@code balancerComputeThreads} in the range [1, 8].
+   */
+  public static int computeNumBalancerThreads(int numUsedSegments)

Review Comment:
   Nit: would it better to consider the number of replicas rather than the 
number of used segments in cases where a lot of segments have 0 replicas in the 
load rule



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to