public DataSet getRegionId(GetRegionIdPlan plan) {
    if (!isDatabaseExisted(plan.getDatabase())) {
      // Return empty result if Database doesn't exist
      return new GetRegionIdResp(
          new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode()), new ArrayList<>());
    }
    DatabasePartitionTable databasePartitionTable = databasePartitionTables.get(plan.getDatabase());
    return new GetRegionIdResp(
        new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode()),
        databasePartitionTable
            .getRegionId(
                plan.getPartitionType(),
                plan.getSeriesSlotId(),
                plan.getStartTimeSlotId(),
                plan.getEndTimeSlotId())
            .stream()
            .distinct()
            .sorted(Comparator.comparing(TConsensusGroupId::getId))
            .collect(Collectors.toList()));
  }
Get the RegionId of the specific Database or seriesSlotId(device).

@param plan GetRegionIdPlan with the specific Database ,seriesSlotId(device) , timeSlotId.
@return GetRegionIdResp with {@link TSStatus} and List{@literal <}TConsensusGroupId{@literal
    >}.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/PartitionInfo.java