Skip to content

Commit

Permalink
Refactor ClusterContextManagerBuilder (#31335)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored May 21, 2024
1 parent 4ecea3c commit dea4eac
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,14 @@ private void createSubscribers(final EventBusContext eventBusContext, final Clus

private void registerOnline(final EventBusContext eventBusContext, final ComputeNodeInstanceContext computeNodeInstanceContext,
final ClusterPersistRepository repository, final ContextManagerBuilderParameter param, final ContextManager contextManager) {
new ComputeNodeStatusService(repository).registerOnline(computeNodeInstanceContext.getInstance());
ComputeNodeStatusService computeNodeStatusService = new ComputeNodeStatusService(repository);
computeNodeStatusService.registerOnline(computeNodeInstanceContext.getInstance());
new GovernanceWatcherFactory(repository,
eventBusContext, param.getInstanceMetaData() instanceof JDBCInstanceMetaData ? param.getDatabaseConfigs().keySet() : Collections.emptyList()).watchListeners();
if (null != param.getLabels()) {
contextManager.getComputeNodeInstanceContext().getInstance().getLabels().addAll(param.getLabels());
}
contextManager.getComputeNodeInstanceContext().getAllClusterInstances().addAll(new ComputeNodeStatusService(repository).loadAllComputeNodeInstances());
contextManager.getComputeNodeInstanceContext().getAllClusterInstances().addAll(computeNodeStatusService.loadAllComputeNodeInstances());
new ClusterEventSubscriberRegistry(contextManager, repository).register();
}

Expand Down

0 comments on commit dea4eac

Please sign in to comment.