Xushaohong commented on code in PR #647:
URL: https://github.com/apache/ratis/pull/647#discussion_r893083663


##########
ratis-server-api/src/main/java/org/apache/ratis/statemachine/StateMachine.java:
##########
@@ -189,6 +189,12 @@ default void notifyGroupRemove() {}
      * @param failedEntry The failed log entry, if there is any.
      */
     default void notifyLogFailed(Throwable cause, LogEntryProto failedEntry) {}
+
+    /**
+     * Notify the {@link StateMachine} that the progress of install snapshot is
+     * completely done. Could trigger the cleanup of snapshots.
+     */
+    default void 
notifyInstallSnapshotFinished(RaftProtos.InstallSnapshotResult result) {}

Review Comment:
   > @Xushaohong , Since the new method is for the state machine to clean up, 
it is useful to pass also the snapshot index; see 
https://issues.apache.org/jira/secure/attachment/13044817/647_review.patch 
(apply on top of the change)
   
   Only one place modified, where the initial value should be consistent as -1
   `private final AtomicLong installedIndex = new 
AtomicLong(INVALID_LOG_INDEX);`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to