private MaxVersionInfo getMaxVersion(File[] versionFiles) {
    long maxVersion = 0;
    int maxVersionIndex = 0;
    for (int i = 0; i < versionFiles.length; i++) {
      long fileVersion = Long.parseLong(versionFiles[i].getName().split(SEPARATOR)[1]);
      if (fileVersion > maxVersion) {
        maxVersion = fileVersion;
        maxVersionIndex = i;
      }
    }
    return new MaxVersionInfo(maxVersion, maxVersionIndex);
  }
An index controller class to balance the performance degradation of frequent disk I/O.
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/IndexController.java