private void upgrade() {
    File directory = new File(storageDir);
    String oldPrefix = Utils.fromTEndPointToString(peer.getEndpoint()) + SEPARATOR;
    Optional.ofNullable(directory.listFiles((dir, name) -> name.startsWith(oldPrefix)))
        .ifPresent(
            files ->
                Arrays.stream(files)
                    .forEach(
                        oldFile -> {
                          String[] splits = oldFile.getName().split(SEPARATOR);
                          long fileVersion = Long.parseLong(splits[splits.length - 1]);
                          File newFile = new File(storageDir, prefix + fileVersion);
                          try {
                            logger.info(
                                "version file upgrade, previous: {}, current: {}",
                                oldFile.getAbsolutePath(),
                                newFile.getAbsolutePath());
                            FileUtils.moveFile(oldFile, newFile);
                          } catch (IOException e) {
                            logger.error("Error occurred when upgrading version file", e);
                          }
                        }));
  }
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