public GetRegionIdResp getRegionId(final TGetRegionIdReq req) {
    final GetRegionIdPlan plan = new GetRegionIdPlan(req.getType());
    if (req.isSetDatabase()) {
      plan.setDatabase(req.getDatabase());
    } else {
      final IDeviceID deviceID =
          Deserializer.DEFAULT_DESERIALIZER.deserializeFrom(ByteBuffer.wrap(req.getDevice()));
      plan.setDatabase(getClusterSchemaManager().getDatabaseNameByDevice(deviceID));
      plan.setSeriesSlotId(executor.getSeriesPartitionSlot(deviceID));
    }
    if (Objects.equals(plan.getDatabase(), "")) {
      // Return empty result if Database not specified
      return new GetRegionIdResp(RpcUtils.SUCCESS_STATUS, new ArrayList<>());
    }
    if (req.isSetStartTimeSlot()) {
      plan.setStartTimeSlotId(req.getStartTimeSlot());
    } else {
      plan.setStartTimeSlotId(new TTimePartitionSlot(0));
    }
    if (req.isSetEndTimeSlot()) {
      plan.setEndTimeSlotId(req.getEndTimeSlot());
    } else {
      plan.setEndTimeSlotId(new TTimePartitionSlot(Long.MAX_VALUE));
    }

    try {
      return (GetRegionIdResp) getConsensusManager().read(plan);
    } catch (final ConsensusException e) {
      LOGGER.warn(CONSENSUS_READ_ERROR, e);
      TSStatus res = new TSStatus(TSStatusCode.EXECUTE_STATEMENT_ERROR.getStatusCode());
      res.setMessage(e.getMessage());
      return new GetRegionIdResp(res, Collections.emptyList());
    }
  }
Check if the specified RegionGroup exists.

@param regionGroupId The specified RegionGroup
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/PartitionManager.java