private Optional<RaftLogSummary> getLatestSummary(RaftGroupId groupId) {
    // initialize the RaftLog Summary for the first time
    final RaftLogSummary summary =
        bookkeeper.computeIfAbsent(
            groupId,
            gid -> {
              final File root;
              try {
                root =
                    serverRef
                        .get()
                        .getServer()
                        .getDivision(groupId)
                        .getRaftStorage()
                        .getStorageDir()
                        .getCurrentDir();
                return new RaftLogSummary(gid, root);
              } catch (IOException e) {
                return null;
              }
            });

    if (summary != null) {
      summary.updateNow();
    }
    return Optional.ofNullable(summary);
  }
Periodically woken up. Will check the snapshot condition and set the snapshot flag.
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/DiskGuardian.java