private <T extends Pair<Tablet, List<Pair<IDeviceID, Integer>>>>
      boolean timestampsAreNonOverlapping(
          final T tabletPair, final Map<IDeviceID, Long> deviceLastTimestampMap) {
    int currentTimestampIndex = 0;
    for (Pair<IDeviceID, Integer> deviceTimestampIndexPair : tabletPair.right) {
      final Long lastDeviceTimestamp = deviceLastTimestampMap.get(deviceTimestampIndexPair.left);
      if (lastDeviceTimestamp != null
          && lastDeviceTimestamp >= tabletPair.left.getTimestamp(currentTimestampIndex)) {
        return false;
      }
      currentTimestampIndex = deviceTimestampIndexPair.right;
      deviceLastTimestampMap.put(
          deviceTimestampIndexPair.left, tabletPair.left.getTimestamp(currentTimestampIndex - 1));
    }

    return true;
  }
A Map is used to record the maximum time each {@link IDeviceID} is written. {@link Pair}
records the Index+1 of the maximum timestamp of IDevice in each {@link Tablet}.

@return If false, the tablet overlaps with the previous tablet; if true, there is no time
    overlap.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/util/builder/PipeTableModelTsFileBuilder.java