Bug 2187: AddServer unit test and bug fixes
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / RaftActorSnapshotMessageSupport.java
index 2db595d743b727fdde09a66d57f8791c0545ac2f..bf0fc10aad944ae8539c8b3b2a4da70020500944 100644 (file)
@@ -55,7 +55,7 @@ class RaftActorSnapshotMessageSupport {
 
     boolean handleSnapshotMessage(Object message) {
         if(message instanceof ApplySnapshot ) {
-            onApplySnapshot(((ApplySnapshot) message).getSnapshot());
+            onApplySnapshot((ApplySnapshot) message);
             return true;
         } else if (message instanceof SaveSnapshotSuccess) {
             onSaveSnapshotSuccess((SaveSnapshotSuccess) message);
@@ -95,10 +95,10 @@ class RaftActorSnapshotMessageSupport {
         context.getSnapshotManager().commit(sequenceNumber, currentBehavior);
     }
 
-    private void onApplySnapshot(Snapshot snapshot) {
+    private void onApplySnapshot(ApplySnapshot message) {
         log.info("{}: Applying snapshot on follower with snapshotIndex: {}, snapshotTerm: {}", context.getId(),
-                snapshot.getLastAppliedIndex(), snapshot.getLastAppliedTerm());
+                message.getSnapshot().getLastAppliedIndex(), message.getSnapshot().getLastAppliedTerm());
 
-        context.getSnapshotManager().apply(snapshot);
+        context.getSnapshotManager().apply(message);
     }
 }