siddharthteotia 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_r307190106
##########
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:
changed the name of these stats to avoid confusion, also tracking the number
of times we updated the ideal state in ZK (which happens after we have made
updates to instance map of each segment)
----------------------------------------------------------------
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]