package org.opendaylight.controller.cluster.raft;
-import org.opendaylight.controller.cluster.raft.behaviors.RaftActorBehavior;
+import org.opendaylight.controller.cluster.raft.base.messages.ApplySnapshot;
public interface SnapshotState {
/**
- * Should return true when a snapshot is being captured
- * @return
+ * @return true when a snapshot is being captured
*/
boolean isCapturing();
*/
boolean captureToInstall(ReplicatedLogEntry lastLogEntry, long replicatedToAllIndex, String targetFollower);
+ /**
+ * Applies a snapshot on a follower that was installed by the leader.
+ *
+ * @param snapshot the Snapshot to apply.
+ */
+ void apply(ApplySnapshot snapshot);
+
/**
* Persist the snapshot
*
* @param currentBehavior
* @param totalMemory
*/
- void persist(byte[] snapshotBytes, RaftActorBehavior currentBehavior, long totalMemory);
+ void persist(byte[] snapshotBytes, long totalMemory);
/**
* Commit the snapshot by trimming the log
* @param desiredTrimIndex
* @return the actual trim index
*/
- long trimLog(long desiredTrimIndex, RaftActorBehavior currentBehavior);
+ long trimLog(long desiredTrimIndex);
}