public static int checkAndCompareFileName(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;
  }
Compare two TsFile's name.This method will first check whether the two names meet the standard
naming specifications, and then use the generating time as the first keyword, and use the
version number as the second keyword to compare the size of the two names. Notice that this
method will not compare the merge count.

@param fileName1 a name of TsFile
@param fileName2 a name of TsFile
@return -1, if fileName1 is smaller than fileNam2, 1 if bigger, 0 means fileName1 equals to
    fileName2
@throws IOException if fileName1 or fileName2 do not meet the standard naming specifications.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/TsFileResource.java