public static TsFileIdentifier getFileIdentifierFromFilePath(String filepath) {
    String splitter = File.separator;
    if ("\\".equals(splitter)) {
      // String.split use a regex way to split the string into array
      // "\" Should be escaped as "\\"
      splitter = "\\\\";
    }
    String[] splittedPath = filepath.split(splitter);
    int length = splittedPath.length;
    if (length < 5) {
      // if the path contains the required information
      // after splitting result should contain more than 5 objects
      throw new RuntimeException(
          String.format("Path %s cannot be parsed into file info", filepath));
    }

    return new TsFileIdentifier(
        splittedPath[length - LOGICAL_SG_OFFSET_IN_PATH],
        splittedPath[length - DATA_REGION_OFFSET_IN_PATH],
        splittedPath[length - TIME_PARTITION_OFFSET_IN_PATH],
        splittedPath[length - SEQUENCE_OFFSET_IN_PATH].equals(IoTDBConstant.SEQUENCE_FOLDER_NAME),
        splittedPath[length - FILE_NAME_OFFSET_IN_PATH]);
  }
This function generates an instance of CompactionFileIdentifier by parsing the path of a
tsfile. Notice, the path of the file should include information of its logical database, data
region id, time partition, sequence or not and its filename, such as
"sequence/root.test.sg/0/0/1-1-0-0.tsfile".
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/log/TsFileIdentifier.java