X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2FSnapshotState.java;h=5d1304fe752222214a82b9d877da996dc517feb4;hp=9a9bf1c774a49c3a87cb285a599da382ecad9931;hb=b8c6400766f7324dd57d059bd48e435569fe1a27;hpb=edcc020c8fda4b13f22a31d79c13feef0b53b0ee diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/SnapshotState.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/SnapshotState.java index 9a9bf1c774..5d1304fe75 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/SnapshotState.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/SnapshotState.java @@ -8,14 +8,11 @@ package org.opendaylight.controller.cluster.raft; -import akka.japi.Procedure; -import org.opendaylight.controller.cluster.DataPersistenceProvider; -import org.opendaylight.controller.cluster.raft.behaviors.RaftActorBehavior; +import org.opendaylight.controller.cluster.raft.base.messages.ApplySnapshot; public interface SnapshotState { /** - * Should return true when a snapshot is being captured - * @return + * @return true when a snapshot is being captured */ boolean isCapturing(); @@ -41,30 +38,27 @@ public interface SnapshotState { boolean captureToInstall(ReplicatedLogEntry lastLogEntry, long replicatedToAllIndex, String targetFollower); /** - * Create the snapshot + * Applies a snapshot on a follower that was installed by the leader. * - * @param callback a procedure to be called which should create the snapshot + * @param snapshot the Snapshot to apply. */ - void create(Procedure callback); + void apply(ApplySnapshot snapshot); /** * Persist the snapshot * - * @param persistenceProvider * @param snapshotBytes * @param currentBehavior * @param totalMemory */ - void persist(DataPersistenceProvider persistenceProvider, byte[] snapshotBytes, RaftActorBehavior currentBehavior - ,long totalMemory); + void persist(byte[] snapshotBytes, long totalMemory); /** * Commit the snapshot by trimming the log * - * @param persistenceProvider * @param sequenceNumber */ - void commit(DataPersistenceProvider persistenceProvider, long sequenceNumber); + void commit(long sequenceNumber); /** * Rollback the snapshot @@ -77,5 +71,5 @@ public interface SnapshotState { * @param desiredTrimIndex * @return the actual trim index */ - long trimLog(long desiredTrimIndex, RaftActorBehavior currentBehavior); + long trimLog(long desiredTrimIndex); }