jackjlli commented on a change in pull request #4102: Cleanup singletons for 3
classes in ControllerStarter
URL: https://github.com/apache/incubator-pinot/pull/4102#discussion_r276477805
##########
File path:
pinot-controller/src/main/java/org/apache/pinot/controller/ControllerStarter.java
##########
@@ -254,8 +257,15 @@ private void setUpPinotController() {
// Helix resource manager must be started in order to create
PinotLLCRealtimeSegmentManager
LOGGER.info("Starting realtime segment manager");
- PinotLLCRealtimeSegmentManager
- .create(_helixResourceManager, _config, _controllerMetrics,
_controllerLeadershipManager);
+
+ _pinotLLCRealtimeSegmentManager =
+ new PinotLLCRealtimeSegmentManager(_helixResourceManager, _config,
_controllerMetrics,
+ _controllerLeadershipManager);
+ // TODO: Need to put this inside HelixResourceManager when
ControllerLeadershipManager is removed.
+
_helixResourceManager.registerPinotLLCRealtimeSegmentManager(_pinotLLCRealtimeSegmentManager);
Review comment:
I've tried that but since the object isn't fully initialized, it will only
assign a null reference to it.
Plus, the logic of these 2 objects are mixed together:
* `Resource manager` has to be instantiated before
`PinotLLCRealtimeSegmentManager`.
* `Resource manager` needs to call the method in
`PinotLLCRealtimeSegmentManager`, which is created after `Resource manager` got
created.
It's a circular reference dependency between these two objects.
----------------------------------------------------------------
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]