ibessonov commented on code in PR #7628:
URL: https://github.com/apache/ignite-3/pull/7628#discussion_r2883295741


##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/topology/LogicalTopologyImpl.java:
##########
@@ -201,8 +198,7 @@ public void removeNodes(Set<LogicalNode> nodesToRemove) {
 
     @Override
     public boolean isNodeInLogicalTopology(LogicalNode needle) {
-        return readLogicalTopology().nodes().stream()
-                .anyMatch(node -> node.id().equals(needle.id()));
+        return readLogicalTopology().hasNode(needle.id());

Review Comment:
   This method reads from disk, it's slow. Please add a TODO for a further 
refactoring



##########
modules/code-deployment/src/main/java/org/apache/ignite/internal/deployunit/metastore/ClusterEventCallbackImpl.java:
##########
@@ -85,15 +81,12 @@ private void undeploy(String id, Version version, UUID 
opId) {
 
     private void removeClusterStatus(String id, Version version, UUID opId) {
         cmgManager.logicalTopology().thenAccept(logicalTopology -> {
-            Set<String> logicalNodes = logicalTopology.nodes().stream()
-                    .map(LogicalNode::name)
-                    .collect(Collectors.toSet());
             deploymentUnitStore.getAllNodeStatuses(id, 
version).thenAccept(statuses -> {
                 boolean emptyTopology = statuses.stream()
-                        .map(UnitNodeStatus::nodeId)
-                        .filter(logicalNodes::contains)
+                        .filter(unitNodeStatus -> 
logicalTopology.hasNode(unitNodeStatus.nodeId()))
                         .findAny()
                         .isEmpty();

Review Comment:
   Please use `noneMatch` instead of this travesty 🙏 



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