narendly commented on a change in pull request #690: Reset the WAGED rebalancer
once the controller newly acquires leadership.
URL: https://github.com/apache/helix/pull/690#discussion_r369863611
##########
File path:
helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
##########
@@ -1259,3 +1287,54 @@ private void initPipeline(Thread eventThread,
BaseControllerDataProvider cache)
eventThread.start();
}
}
+
+/**
+ * A wrapper class for the WAGED rebalancer instance.
+ */
+class WagedRebalancerRef {
+ private WagedRebalancer _rebalancer = null;
+ private boolean _isRebalancerValid = true;
+
+ private void createWagedRebalancer(HelixManager helixManager) {
+ // Create WagedRebalancer instance if it hasn't been already initialized
+ if (_rebalancer == null) {
+ _rebalancer = new WagedRebalancer(helixManager);
+ _isRebalancerValid = true;
+ }
+ }
+
+ /**
+ * Mark the current rebalancer object to be invalid, which indicates it
needs to be reset before
+ * the next usage.
+ */
+ synchronized void invalidRebalancer() {
Review comment:
"invalidate"Rebalancer?
----------------------------------------------------------------
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]