kfaraz commented on code in PR #14584:
URL: https://github.com/apache/druid/pull/14584#discussion_r1295536568
##########
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:
The javadoc calls it out that we are using `numUsedSegments` as a proxy for
the number of replicas. If we count number of replicas at this point, we might
under-estimate the number of segments as some unavailable segments might not
have been assigned yet (since this is before the `RunRules` duty). This might
lead to too few threads.
--
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]