public void checkAndFlushIndex() {
    if (!threads.isEmpty()) {
      threads.forEach(
          thread -> {
            IndexController controller = thread.getController();
            controller.update(controller.getCurrentIndex(), true);
          });
      // do not set SafelyDeletedSearchIndex as it is Long.MAX_VALUE when replica is 1
      reader.setSafelyDeletedSearchIndex(impl.getMinFlushedSyncIndex());
    }
  }
Manage all asynchronous replication threads and corresponding async clients.
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/LogDispatcher.java