BUG 2185 : Introduce the SwitchBehavior message
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / SnapshotState.java
index 9949211c63c416d69fb6a97ba6d6ae6bc823c086..46e0c87fc21d6ca6bb9a5a49e4ec9aa8538cc969 100644 (file)
@@ -12,8 +12,7 @@ import org.opendaylight.controller.cluster.raft.behaviors.RaftActorBehavior;
 
 public interface SnapshotState {
     /**
-     * Should return true when a snapshot is being captured
-     * @return
+     * @return true when a snapshot is being captured
      */
     boolean isCapturing();
 
@@ -38,6 +37,13 @@ public interface SnapshotState {
      */
     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(Snapshot snapshot);
+
     /**
      * Persist the snapshot
      *
@@ -52,7 +58,7 @@ public interface SnapshotState {
      *
      * @param sequenceNumber
      */
-    void commit(long sequenceNumber);
+    void commit(long sequenceNumber, RaftActorBehavior currentBehavior);
 
     /**
      * Rollback the snapshot