Add an option to trigger snapshot creation on root overwrites
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / SnapshotState.java
index 0a702741d8894ceb46386fba63d28ca39e1e51af..acb6e01230ecd64b8b6625f3f1c54eae227bd629 100644 (file)
@@ -46,6 +46,14 @@ public interface SnapshotState {
      */
     boolean captureToInstall(ReplicatedLogEntry lastLogEntry, long replicatedToAllIndex, String targetFollower);
 
+    /**
+     * Initiates a capture snapshot, while enforcing trimming of the log up to lastAppliedIndex.
+     * @param lastLogEntry the last entry in the replicated log
+     * @param replicatedToAllIndex the current replicatedToAllIndex
+     * @return true if capture was started
+     */
+    boolean captureWithForcedTrim(ReplicatedLogEntry lastLogEntry, long replicatedToAllIndex);
+
     /**
      * Applies a snapshot on a follower that was installed by the leader.
      *