public synchronized void update(long index, boolean forcePersist) {
    long newCurrentIndex = Math.max(currentIndex, index);
    logger.debug(
        "update index from currentIndex {} to {} for file prefix {} in {}",
        currentIndex,
        newCurrentIndex,
        prefix,
        storageDir);
    currentIndex = newCurrentIndex;
    checkPersist(forcePersist);
  }
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