public CountTimeSlotListResp countTimeSlotList(TCountTimeSlotListReq req) {
    long startTime = req.isSetStartTime() ? req.getStartTime() : Long.MIN_VALUE;
    long endTime = req.isSetEndTime() ? req.getEndTime() : Long.MAX_VALUE;
    CountTimeSlotListPlan plan = new CountTimeSlotListPlan(startTime, endTime);
    if (req.isSetDatabase()) {
      plan.setDatabase(req.getDatabase());
    } else if (req.isSetDevice()) {
      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 CountTimeSlotListResp(RpcUtils.SUCCESS_STATUS, 0);
      }
    } else {
      plan.setRegionId(
          new TConsensusGroupId(TConsensusGroupType.DataRegion, (int) req.getRegionId()));
    }
    try {
      return (CountTimeSlotListResp) getConsensusManager().read(plan);
    } catch (ConsensusException e) {
      LOGGER.warn(CONSENSUS_READ_ERROR, e);
      TSStatus res = new TSStatus(TSStatusCode.EXECUTE_STATEMENT_ERROR.getStatusCode());
      res.setMessage(e.getMessage());
      return new CountTimeSlotListResp(res, 0);
    }
  }
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