mcvsubbu commented on a change in pull request #4446: Add support in the
rebalancer for the user to provide minimum number of serving replicas
URL: https://github.com/apache/incubator-pinot/pull/4446#discussion_r306573051
##########
File path:
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/TableRebalancer.java
##########
@@ -300,4 +399,55 @@ private void waitForStable(String resourceName)
}
} while (diff > 0);
}
+
+ /**
+ * Helper class that maintains stats that
+ * are later checked in tests to verify
+ * the behavior of the algorithm here
+ * that takes from current ideal state
+ * to a target ideal state
+ */
+ public static class RebalancerStats {
+ private int dryRun;
+ private int directTransitions;
+ private int incrementalTransitions;
+
+ RebalancerStats() {
+ }
+
+ /**
+ * Number of dry runs. Can only be 1
+ * @return
+ */
+ public int getDryRun() {
+ return dryRun;
+ }
+
+ /**
+ * Get the number of times we updated the ideal
+ * state at one go. This happens in downtime
+ * rebalancing and can also happen in no-downtime
+ * rebalancing if there are sufficient common
+ * hosts between current and target ideal states
+ * @return direct transitions
+ */
+ public int getDirectTransitions() {
+ return directTransitions;
+ }
+
+ /**
+ * Get the number of times we updated the ideal
Review comment:
this is really number of segments we updated, because we bump this once for
each segment that we change in idealstate. We may then update the idealstate in
one go for all the segments. We should also keep the number of idealstate
updates as a separate stat.
----------------------------------------------------------------
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]