You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/10/06 04:20:25 UTC

[GitHub] [iotdb] yschengzi opened a new pull request, #7527: [IOTDB-3656] mpp load supports tsfile with non-standard name

yschengzi opened a new pull request, #7527:
URL: https://github.com/apache/iotdb/pull/7527

   - [x] support load .mods
   - [ ] last cache
   - [x] clean up
   - [x] tsfile name restriction
   
   solution:
   assume tow TsFiles with name tsfile1, and tsfile2
   if tsfile1 and tsfile2 both have standard TsFile Name (i.e. createtime-version-mergecnt-mergecnt)
   then compare two TsFiles with standard methods (i.e. compare createtime firstly, and then compre version.)
   else compare two file name with String.compareTo
   


-- 
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-unsubscribe@iotdb.apache.org

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


[GitHub] [iotdb] yschengzi commented on a diff in pull request #7527: [IOTDB-3656] mpp load supports tsfile with non-standard name

Posted by GitBox <gi...@apache.org>.
yschengzi commented on code in PR #7527:
URL: https://github.com/apache/iotdb/pull/7527#discussion_r990980412


##########
server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java:
##########
@@ -963,6 +963,20 @@ public static int compareFileName(TsFileResource o1, TsFileResource o2) {
     }
   }
 
+  public static int compareFileName(String fileName1, String fileName2) throws IOException {
+    TsFileNameGenerator.TsFileName tsFileName1 = TsFileNameGenerator.getTsFileName(fileName1);
+    TsFileNameGenerator.TsFileName tsFileName2 = TsFileNameGenerator.getTsFileName(fileName2);
+    long timeDiff = tsFileName1.getTime() - tsFileName2.getTime();
+    if (timeDiff != 0) {
+      return timeDiff < 0 ? -1 : 1;
+    }
+    long versionDiff = tsFileName1.getVersion() - tsFileName2.getVersion();
+    if (versionDiff != 0) {
+      return versionDiff < 0 ? -1 : 1;
+    }
+    return 0;
+  }
+

Review Comment:
   done.



-- 
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-unsubscribe@iotdb.apache.org

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


[GitHub] [iotdb] HTHou commented on a diff in pull request #7527: [IOTDB-3656] mpp load supports tsfile with non-standard name

Posted by GitBox <gi...@apache.org>.
HTHou commented on code in PR #7527:
URL: https://github.com/apache/iotdb/pull/7527#discussion_r990606211


##########
server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java:
##########
@@ -963,6 +963,20 @@ public static int compareFileName(TsFileResource o1, TsFileResource o2) {
     }
   }
 
+  public static int compareFileName(String fileName1, String fileName2) throws IOException {
+    TsFileNameGenerator.TsFileName tsFileName1 = TsFileNameGenerator.getTsFileName(fileName1);
+    TsFileNameGenerator.TsFileName tsFileName2 = TsFileNameGenerator.getTsFileName(fileName2);
+    long timeDiff = tsFileName1.getTime() - tsFileName2.getTime();
+    if (timeDiff != 0) {
+      return timeDiff < 0 ? -1 : 1;
+    }
+    long versionDiff = tsFileName1.getVersion() - tsFileName2.getVersion();
+    if (versionDiff != 0) {
+      return versionDiff < 0 ? -1 : 1;
+    }
+    return 0;
+  }
+

Review Comment:
   Add some annotations. 
   It is hard to understand the differences of `compareFileName(TsFileResource o1, TsFileResource o2)` method.



-- 
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-unsubscribe@iotdb.apache.org

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


[GitHub] [iotdb] HTHou merged pull request #7527: [IOTDB-3656] mpp load supports tsfile with non-standard name

Posted by GitBox <gi...@apache.org>.
HTHou merged PR #7527:
URL: https://github.com/apache/iotdb/pull/7527


-- 
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-unsubscribe@iotdb.apache.org

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


[GitHub] [iotdb] HTHou commented on a diff in pull request #7527: [IOTDB-3656] mpp load supports tsfile with non-standard name

Posted by GitBox <gi...@apache.org>.
HTHou commented on code in PR #7527:
URL: https://github.com/apache/iotdb/pull/7527#discussion_r990606211


##########
server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java:
##########
@@ -963,6 +963,20 @@ public static int compareFileName(TsFileResource o1, TsFileResource o2) {
     }
   }
 
+  public static int compareFileName(String fileName1, String fileName2) throws IOException {
+    TsFileNameGenerator.TsFileName tsFileName1 = TsFileNameGenerator.getTsFileName(fileName1);
+    TsFileNameGenerator.TsFileName tsFileName2 = TsFileNameGenerator.getTsFileName(fileName2);
+    long timeDiff = tsFileName1.getTime() - tsFileName2.getTime();
+    if (timeDiff != 0) {
+      return timeDiff < 0 ? -1 : 1;
+    }
+    long versionDiff = tsFileName1.getVersion() - tsFileName2.getVersion();
+    if (versionDiff != 0) {
+      return versionDiff < 0 ? -1 : 1;
+    }
+    return 0;
+  }
+

Review Comment:
   Add some annotations. 
   It is hard to understand the differences with `compareFileName(TsFileResource o1, TsFileResource o2)` method.



-- 
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-unsubscribe@iotdb.apache.org

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