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%2FSnapshotManager.java;h=e6dc8bb367d6f0c27c49765e52e6dbdbcaa7de73;hp=dd9445e749d3526c3484121232fec7e274b71194;hb=3859df9beca8f13f1ff2b2744ed3470a1715bec3;hpb=2d60632f7cf63712e8357a3cf3fc40d83366e5e6 diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/SnapshotManager.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/SnapshotManager.java index dd9445e749..e6dc8bb367 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/SnapshotManager.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/SnapshotManager.java @@ -5,7 +5,6 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.controller.cluster.raft; import akka.persistence.SnapshotSelectionCriteria; @@ -16,7 +15,7 @@ import java.io.OutputStream; import java.util.List; import java.util.Optional; import java.util.function.Consumer; -import javax.annotation.Nonnull; +import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.controller.cluster.io.FileBackedOutputStream; import org.opendaylight.controller.cluster.raft.base.messages.ApplySnapshot; import org.opendaylight.controller.cluster.raft.base.messages.CaptureSnapshot; @@ -56,7 +55,7 @@ public class SnapshotManager implements SnapshotState { private CaptureSnapshot captureSnapshot; private long lastSequenceNumber = -1; - private Consumer> createSnapshotProcedure; + private Consumer> createSnapshotProcedure = null; private ApplySnapshot applySnapshot; private RaftActorSnapshotCohort snapshotCohort = NoopRaftActorSnapshotCohort.INSTANCE; @@ -127,8 +126,7 @@ public class SnapshotManager implements SnapshotState { this.snapshotCohort = snapshotCohort; } - @Nonnull - public Snapshot.State convertSnapshot(final ByteSource snapshotBytes) throws IOException { + public Snapshot.@NonNull State convertSnapshot(final ByteSource snapshotBytes) throws IOException { return snapshotCohort.deserializeSnapshot(snapshotBytes); } @@ -471,7 +469,7 @@ public class SnapshotManager implements SnapshotState { context.getReplicatedLog().snapshotCommit(); } - context.getPersistenceProvider().deleteSnapshots(new SnapshotSelectionCriteria(sequenceNumber, + context.getPersistenceProvider().deleteSnapshots(new SnapshotSelectionCriteria(scala.Long.MaxValue(), timeStamp - 1, 0L, 0L)); context.getPersistenceProvider().deleteMessages(lastSequenceNumber);