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_r370773330
##########
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:
The vision is not clear to me. I don't think we have a solid idea for the
TODO. For example, relying on the cluster config to set up the rebalancer type
may be invalid. If we have multiple optional stateful rebalancers, they will be
configured in the ideal state for each resource, instead of cluster config.
More likely, we will need to init all the stateful rebalancers here. It is
just too far even for planning. For now, please assume we will only have one
stateful rebalancer.
However, making the code generic enough for the future extension is always a
good idea. That why I added the interface according to your suggestion : )
----------------------------------------------------------------
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]