Merge "Notification Listener Adapter uses NotificationListenerInvoker"
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / RaftActor.java
index 030ab303393f108d98a52230e5d8de3bcc4ddb6c..157a53ed2d1797b662f6fadccd3acf4027ae442f 100644 (file)
@@ -124,7 +124,8 @@ public abstract class RaftActor extends AbstractUntypedPersistentActor {
         context = new RaftActorContextImpl(this.getSelf(),
             this.getContext(), id, new ElectionTermImpl(delegatingPersistenceProvider, id, LOG),
             -1, -1, peerAddresses,
-            (configParams.isPresent() ? configParams.get(): new DefaultConfigParamsImpl()), LOG);
+            (configParams.isPresent() ? configParams.get(): new DefaultConfigParamsImpl()),
+            delegatingPersistenceProvider, LOG);
 
         context.setReplicatedLog(ReplicatedLogImpl.newInstance(context, delegatingPersistenceProvider, currentBehavior));
     }
@@ -193,8 +194,7 @@ public abstract class RaftActor extends AbstractUntypedPersistentActor {
     @Override
     public void handleCommand(Object message) {
         if(snapshotSupport == null) {
-            snapshotSupport = new RaftActorSnapshotMessageSupport(delegatingPersistenceProvider, context,
-                    currentBehavior, getRaftActorSnapshotCohort(), self());
+            snapshotSupport = newRaftActorSnapshotMessageSupport();
         }
 
         boolean handled = snapshotSupport.handleSnapshotMessage(message);
@@ -244,6 +244,11 @@ public abstract class RaftActor extends AbstractUntypedPersistentActor {
         }
     }
 
+    protected RaftActorSnapshotMessageSupport newRaftActorSnapshotMessageSupport() {
+        return new RaftActorSnapshotMessageSupport(delegatingPersistenceProvider, context,
+                currentBehavior, getRaftActorSnapshotCohort());
+    }
+
     private void onGetOnDemandRaftStats() {
         // Debugging message to retrieve raft stats.
 
@@ -567,6 +572,12 @@ public abstract class RaftActor extends AbstractUntypedPersistentActor {
         return getRaftActorContext().hasFollowers();
     }
 
+    /**
+     * @deprecated Deprecated in favor of {@link org.opendaylight.controller.cluster.raft.base.messages.DeleteEntriesTest}
+     *             whose type for fromIndex is long instead of int. This class was kept for backwards
+     *             compatibility with Helium.
+     */
+    @Deprecated
     static class DeleteEntries implements Serializable {
         private static final long serialVersionUID = 1L;
         private final int fromIndex;