public Set<TConsensusGroupId> getRemovedDataNodesRegionSet(
      List<TDataNodeLocation> removedDataNodes) {
    return removedDataNodes.stream()
        .map(this::getMigratedDataNodeRegions)
        .flatMap(List::stream)
        .collect(Collectors.toSet());
  }
Retrieves all consensus group IDs from the specified removed DataNodes.

@param removedDataNodes the list of removed DataNodes
@return a set of TConsensusGroupId representing the consensus groups associated with the
    removed DataNodes
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/RemoveDataNodeHandler.java