xtern commented on code in PR #4042:
URL: https://github.com/apache/ignite-3/pull/4042#discussion_r1665602794
##########
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/impl/MetaStorageLeaderElectionListener.java:
##########
@@ -91,18 +93,22 @@ public class MetaStorageLeaderElectionListener implements
LeaderElectionListener
LogicalTopologyService logicalTopologyService,
CompletableFuture<MetaStorageServiceImpl> metaStorageSvcFut,
ClusterTimeImpl clusterTime,
- CompletableFuture<MetaStorageConfiguration>
metaStorageConfigurationFuture
+ CompletableFuture<MetaStorageConfiguration>
metaStorageConfigurationFuture,
+ List<ElectionListener> electionListeners
) {
this.busyLock = busyLock;
this.nodeName = clusterService.nodeName();
this.logicalTopologyService = logicalTopologyService;
this.metaStorageSvcFut = metaStorageSvcFut;
this.clusterTime = clusterTime;
this.metaStorageConfigurationFuture = metaStorageConfigurationFuture;
+ this.electionListeners = electionListeners;
}
@Override
public void onLeaderElected(ClusterNode node, long term) {
+ electionListeners.forEach(listener -> listener.onLeaderElected(node));
Review Comment:
It looks like the javadoc should note that the listener is called on the
same thread as the MetaStorageLeaderElectionListener, and therefore shouldn't
contain slow computations?
--
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]