Bug 2187: AddServer unit test and bug fixes
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / SnapshotState.java
index 9949211c63c416d69fb6a97ba6d6ae6bc823c086..f5a175f3891de08defa6a0a7cefccf816fbf8213 100644 (file)
@@ -8,12 +8,12 @@
 
 package org.opendaylight.controller.cluster.raft;
 
+import org.opendaylight.controller.cluster.raft.base.messages.ApplySnapshot;
 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 +38,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(ApplySnapshot snapshot);
+
     /**
      * Persist the snapshot
      *
@@ -52,7 +59,7 @@ public interface SnapshotState {
      *
      * @param sequenceNumber
      */
-    void commit(long sequenceNumber);
+    void commit(long sequenceNumber, RaftActorBehavior currentBehavior);
 
     /**
      * Rollback the snapshot