public List<TTimePartitionSlot> getTimeSlotList(
      TSeriesPartitionSlot seriesSlotId, TConsensusGroupId regionId, long startTime, long endTime) {
    if (seriesSlotId.getSlotId() == -1) {
      // query timePartition of specific database or region
      List<TTimePartitionSlot> timePartitionSlots = new ArrayList<>();
      dataPartitionMap.forEach(
          (seriesPartitionSlot, seriesPartitionTable) ->
              timePartitionSlots.addAll(
                  seriesPartitionTable.getTimeSlotList(regionId, startTime, endTime)));
      return timePartitionSlots;
    } else if (!dataPartitionMap.containsKey(seriesSlotId)) {
      return new ArrayList<>();
    } else {
      // query timePartition of specific seriesPartition
      SeriesPartitionTable seriesPartitionTable = dataPartitionMap.get(seriesSlotId);
      return seriesPartitionTable.getTimeSlotList(regionId, startTime, endTime);
    }
  }
Query timePartition

@param seriesSlotId SeriesPartitionSlot
@param regionId TConsensusGroupId
@param startTime startTime
@return the timePartition if seriesSlotId==-1 && regionId == -1, then return all timePartition.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/partition/DataPartitionTable.java