jt2594838 commented on code in PR #12666:
URL: https://github.com/apache/iotdb/pull/12666#discussion_r1627366108


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/timeindex/FileTimeIndex.java:
##########
@@ -247,4 +247,9 @@ public Pair<Long, Long> getPossibleStartTimeAndEndTime(
   public byte getTimeIndexType() {
     return FILE_TIME_INDEX_TYPE;
   }
+
+  @Override
+  public String toString() {
+    return " StartTimes = " + startTime + " EndTimes = " + endTime;

Review Comment:
   StartTimes -> StartTime
   EndTimes -> EndTime



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/timeindex/FileTimeIndex.java:
##########
@@ -247,4 +247,9 @@ public Pair<Long, Long> getPossibleStartTimeAndEndTime(
   public byte getTimeIndexType() {
     return FILE_TIME_INDEX_TYPE;
   }
+
+  @Override
+  public String toString() {
+    return " StartTimes = " + startTime + " EndTimes = " + endTime;

Review Comment:
   StartTimes -> StartTime
   EndTimes -> EndTime



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/TsFileResource.java:
##########
@@ -388,12 +388,29 @@ public long getTsFileSize() {
   }
 
   public long getStartTime(IDeviceID deviceId) {
-    return deviceId == null ? getFileStartTime() : 
timeIndex.getStartTime(deviceId);
+    try {
+      return deviceId == null ? getFileStartTime() : 
timeIndex.getStartTime(deviceId);
+    } catch (Exception e) {
+      LOGGER.error(
+          "meet error when getStartTime of {} in file {}", deviceId, 
file.getAbsolutePath());
+      if (LOGGER.isDebugEnabled()) {
+        LOGGER.debug("TimeIndex = {}", timeIndex.toString());

Review Comment:
   Unnecessary toString() and thus if-clause.
   How about also reporting the exception?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to