private long getTimePartitionWithCheck() throws PartitionViolationException {
    Long partitionId = null;

    for (final int index : deviceToIndex.values()) {
      final long startTimePartitionId = TimePartitionUtils.getTimePartitionId(startTimes[index]);
      final long endTimePartitionId = TimePartitionUtils.getTimePartitionId(endTimes[index]);

      if (startTimePartitionId != endTimePartitionId) {
        throw new PartitionViolationException();
      }

      if (partitionId == null) {
        partitionId = startTimePartitionId;
        continue;
      }

      if (partitionId != startTimePartitionId) {
        throw new PartitionViolationException();
      }
    }

    // Just in case
    if (partitionId == null) {
      throw new PartitionViolationException();
    }

    return partitionId;
  }
Deserialize TimeIndex and get devices only.

@param inputStream inputStream
@return device name
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/timeindex/ArrayDeviceTimeIndex.java