public List<RegionMigrationPlan> getRegionMigrationPlans(
      List<TDataNodeLocation> removedDataNodes) {
    List<RegionMigrationPlan> regionMigrationPlans = new ArrayList<>();
    for (TDataNodeLocation removedDataNode : removedDataNodes) {
      List<TConsensusGroupId> migratedDataNodeRegions = getMigratedDataNodeRegions(removedDataNode);
      regionMigrationPlans.addAll(
          migratedDataNodeRegions.stream()
              .map(regionId -> RegionMigrationPlan.create(regionId, removedDataNode))
              .collect(Collectors.toList()));
    }
    return regionMigrationPlans;
  }
Retrieves all region migration plans for the specified removed DataNodes.

@param removedDataNodes the list of DataNodes from which to obtain migration plans
@return a list of region migration plans associated with the removed DataNodes
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/RemoveDataNodeHandler.java