sanpwc commented on code in PR #3220:
URL: https://github.com/apache/ignite-3/pull/3220#discussion_r1500684098


##########
modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java:
##########
@@ -990,6 +994,37 @@ public CompletableFuture<Ignite> start(Path configPath) {
 
                         return cmgMgr.onJoinReady();
                     }, startupExecutor)
+                    .thenComposeAsync(ignored -> {
+                        CompletableFuture<Void> 
awaitSelfInLogicalTopologyFuture = new CompletableFuture<>();
+
+                        LogicalTopologyEventListener awaitSelfListener = new 
LogicalTopologyEventListener() {
+                            @Override
+                            public void onNodeJoined(LogicalNode joinedNode, 
LogicalTopologySnapshot newTopology) {
+                                if 
(newTopology.nodes().stream().map(LogicalNode::id).collect(Collectors.toSet()).contains(id()))
 {
+                                    
awaitSelfInLogicalTopologyFuture.complete(null);
+                                    
logicalTopologyService.removeEventListener(this);
+                                }
+                            }
+
+                            @Override
+                            public void onTopologyLeap(LogicalTopologySnapshot 
newTopology) {
+                                if 
(newTopology.nodes().stream().map(LogicalNode::id).collect(Collectors.toSet()).contains(id()))
 {

Review Comment:
   Don't think that it's really needed, taking into considiration that 
everething inside thenCompose will be extracted I'd rather left inner 
duplication as is. However if you will intend I'll also add a private helper 
for this.



-- 
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]

Reply via email to