public Set<TDataNodeLocation> getRelatedDataNodeLocations(TDataNodeLocation removedDataNode) {
    return configManager.getPartitionManager().getAllReplicaSets().stream()
        .filter(replicaSet -> replicaSet.getDataNodeLocations().contains(removedDataNode))
        .flatMap(replicaSet -> replicaSet.getDataNodeLocations().stream())
        .collect(Collectors.toSet());
  }
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
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/RemoveDataNodeHandler.java