Bug 7521: Convert Snapshot to store a State instance
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / SnapshotState.java
index e423737706bc0d42055d388bb72b7f4a7890256b..0a702741d8894ceb46386fba63d28ca39e1e51af 100644 (file)
@@ -8,7 +8,10 @@
 
 package org.opendaylight.controller.cluster.raft;
 
+import java.io.OutputStream;
+import java.util.Optional;
 import org.opendaylight.controller.cluster.raft.base.messages.ApplySnapshot;
+import org.opendaylight.controller.cluster.raft.persisted.Snapshot;
 
 /**
  * Interface for a snapshot phase state.
@@ -53,10 +56,12 @@ public interface SnapshotState {
     /**
      * Persists a snapshot.
      *
-     * @param snapshotBytes the snapshot bytes
+     * @param snapshotState the snapshot State
+     * @param installSnapshotStream Optional OutputStream that is present if the snapshot is to also be installed
+     *        on a follower.
      * @param totalMemory the total memory threshold
      */
-    void persist(byte[] snapshotBytes, long totalMemory);
+    void persist(Snapshot.State snapshotState, Optional<OutputStream> installSnapshotStream, long totalMemory);
 
     /**
      * Commit the snapshot by trimming the log.