@Override
  public Optional<Long> getEndTime(IDeviceID deviceId) {
    Integer index = deviceToIndex.get(deviceId);
    if (index == null) {
      return Optional.empty();
    } else {
      return Optional.of(endTimes[index]);
    }
  }
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