jiajunwang 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_r370776068
##########
File path:
helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
##########
@@ -187,6 +188,16 @@
private HelixManager _helixManager;
+ // Since the stateful rebalancer needs to be lazily constructed when the
HelixManager instance is
+ // ready, the GenericHelixController is not constructed with a stateful
rebalancer. This wrapper
+ // is to avoid the complexity of handling a nullable value in the event
handling process.
+ private final StatefulRebalancerRef _rebalancerRef = new
StatefulRebalancerRef() {
+ @Override
+ protected StatefulRebalancer createRebalancer(HelixManager helixManager) {
+ return new WagedRebalancer(helixManager);
+ }
Review comment:
In addition, about your 2nd paragraph comment, I guess what you concerned
about is that the rebalancer class should be only configurable in the IS. So
the GenericHelixController should not be aware of the resource level thing.
However, please note that even there is no resource using the WAGED rebalancer,
the controller will still need to init the stateful rebalancer instance.
I agree this design can be improved. But I would prefer to keep it simple
before the rebalancer logic and the algorithm are stable enough.
For now, let me add a TODO.
----------------------------------------------------------------
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]