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 2021/01/21 09:41:43 UTC

[GitHub] [iotdb] jixuan1989 commented on a change in pull request #2533: fix the bug that when introduce the virtual sg, the path not consist with the tsfile's in snapshot

jixuan1989 commented on a change in pull request #2533:
URL: https://github.com/apache/iotdb/pull/2533#discussion_r561731787



##########
File path: server/src/main/java/org/apache/iotdb/db/utils/FilePathUtils.java
##########
@@ -50,36 +51,84 @@ private FilePathUtils() {
 
   /**
    * Format file path to end with File.separator
+   *
    * @param filePath origin file path
    * @return Regularized Path
    */
-  public static String regularizePath(String filePath){
+  public static String regularizePath(String filePath) {
     if (filePath.length() > 0
         && filePath.charAt(filePath.length() - 1) != File.separatorChar) {
       filePath = filePath + File.separatorChar;
     }
     return filePath;
   }
 
+  /**
+   * IMPORTANT, when the path of TsFile changes, the following methods should be changed
+   * accordingly. The sequence TsFile is located at ${IOTDB_DATA_DIR}/data/sequence/. The unsequence
+   * TsFile is located at ${IOTDB_DATA_DIR}/data/unsequence/. Where different storage group's TsFile
+   * is located at <logicalStorageGroupName>/<virtualStorageGroupName>/<timePartitionId>/<fileName>.
+   * For example, one sequence TsFile may locate at /data/data/sequence/root.group_9/0/0/1611199237113-4-0.tsfile
+   *
+   * @param resource the tsFileResource

Review comment:
       UT is important for this class, as it is very important to guarantee it works on all platforms.
   
   In some degree, IT is also useful. If we have IT, then we can guarantee other committers have to modify this function if they modified the position of the tsfiles.
   E.g., start IoTDB -> write some data -> flush -> split the real data file path.




----------------------------------------------------------------
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.

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