liyuheng55555 commented on code in PR #14145:
URL: https://github.com/apache/iotdb/pull/14145#discussion_r1849689493


##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/RemoveDataNodeHandler.java:
##########
@@ -481,4 +481,21 @@ public List<TConsensusGroupId> 
getMigratedDataNodeRegions(TDataNodeLocation remo
         .map(TRegionReplicaSet::getRegionId)
         .collect(Collectors.toList());
   }
+
+  /**
+   * Retrieves all DataNodes related to the specified DataNode.
+   *
+   * @param removedDataNode the DataNode to be removed
+   * @return a set of TDataNodeLocation representing the DataNodes associated 
with the specified
+   *     DataNode
+   */
+  public Set<TDataNodeLocation> getRelatedDataNodeLocations(TDataNodeLocation 
removedDataNode) {
+    return configManager.getPartitionManager().getAllReplicaSets().stream()
+        .filter(
+            replicaSet ->
+                replicaSet.getDataNodeLocations().contains(removedDataNode)
+                    && replicaSet.regionId.getType() != 
TConsensusGroupType.ConfigRegion)

Review Comment:
   Unnecessary check? getAllReplicaSets() won't return config region



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