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=b0cbf4b00f6c9f39daadbc23b76b8eab81df89b2;hb=b8c6400766f7324dd57d059bd48e435569fe1a27;hpb=cd5b4bd47e1cfc40751ef15f6fcdf33fc131c1f8 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 b0cbf4b00f..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,13 +8,11 @@ package org.opendaylight.controller.cluster.raft; -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(); @@ -39,24 +37,28 @@ 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 * - * @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 @@ -69,5 +71,5 @@ public interface SnapshotState { * @param desiredTrimIndex * @return the actual trim index */ - long trimLog(long desiredTrimIndex, RaftActorBehavior currentBehavior); + long trimLog(long desiredTrimIndex); }