Cyrill commented on code in PR #7507:
URL: https://github.com/apache/ignite-3/pull/7507#discussion_r2853097646
##########
modules/raft/src/main/java/org/apache/ignite/internal/raft/client/PhysicalTopologyAwareRaftGroupService.java:
##########
@@ -109,80 +132,71 @@ private PhysicalTopologyAwareRaftGroupService(
PeersAndLearners configuration,
Marshaller cmdMarshaller,
ExceptionFactory stoppingExceptionFactory,
- ThrottlingContextHolder throttlingContextHolder,
RaftGroupEventsClientListener eventsClientListener
) {
+ this.groupId = groupId;
this.failureManager = failureManager;
this.clusterService = clusterService;
- this.executor = executor;
- this.raftConfiguration = raftConfiguration;
this.stoppingExceptionFactory = stoppingExceptionFactory;
- this.raftClient = RaftGroupServiceImpl.start(
- groupId,
- clusterService,
- MESSAGES_FACTORY,
- raftConfiguration,
- configuration,
- executor,
- cmdMarshaller,
- stoppingExceptionFactory,
- throttlingContextHolder
- );
+ this.peers = List.copyOf(configuration.peers());
+ this.learners = List.copyOf(configuration.learners());
this.commandExecutor = new RaftCommandExecutor(
groupId,
- raftClient::peers,
+ this::peers,
clusterService,
executor,
raftConfiguration,
cmdMarshaller,
stoppingExceptionFactory
);
+ this.messageSender = new
SubscriptionMessageSender(clusterService.messagingService(), executor,
raftConfiguration);
+
this.generalLeaderElectionListener = new ServerEventHandler(executor);
- eventsClientListener.addLeaderElectionListener(raftClient.groupId(),
generalLeaderElectionListener);
+ this.eventsClientListener = eventsClientListener;
+ eventsClientListener.addLeaderElectionListener(groupId,
generalLeaderElectionListener);
// Subscribe the command executor's leader availability state to
leader election notifications.
subscribeLeader(commandExecutor.leaderElectionListener());
TopologyService topologyService = clusterService.topologyService();
- topologyService.addEventHandler(new TopologyEventHandler() {
+ this.topologyEventHandler = new TopologyEventHandler() {
@Override
public void onAppeared(InternalClusterNode member) {
Review Comment:
done
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]