public List<TConsensusGroupId> getMigratedDataNodeRegions(TDataNodeLocation removedDataNode) {
    return configManager.getPartitionManager().getAllReplicaSets().stream()
        .filter(replicaSet -> replicaSet.getDataNodeLocations().contains(removedDataNode))
        .map(TRegionReplicaSet::getRegionId)
        .collect(Collectors.toList());
  }
Retrieves all consensus group IDs from the specified DataNode.

@param removedDataNode the DataNode to be removed
@return a list of group IDs that need to be migrated
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/RemoveDataNodeHandler.java