X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2Futils%2FInMemorySnapshotStore.java;h=662a063788fd522412d778eff71000bfcdaa9507;hb=refs%2Fchanges%2F32%2F83832%2F8;hp=4c3ad09d5172a6b7fe0203cc8ea193ee2da2c11f;hpb=2d60632f7cf63712e8357a3cf3fc40d83366e5e6;p=controller.git diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/InMemorySnapshotStore.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/InMemorySnapshotStore.java index 4c3ad09d51..662a063788 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/InMemorySnapshotStore.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/InMemorySnapshotStore.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.utils; import akka.dispatch.Futures; @@ -13,7 +12,6 @@ import akka.persistence.SelectedSnapshot; import akka.persistence.SnapshotMetadata; import akka.persistence.SnapshotSelectionCriteria; import akka.persistence.snapshot.japi.SnapshotStore; -import com.google.common.collect.Lists; import com.google.common.util.concurrent.Uninterruptibles; import java.util.ArrayList; import java.util.Collections; @@ -59,7 +57,7 @@ public class InMemorySnapshotStore extends SnapshotStore { List retList; synchronized (stored) { - retList = Lists.newArrayListWithCapacity(stored.size()); + retList = new ArrayList<>(stored.size()); for (StoredSnapshot s: stored) { if (type.isInstance(s.data)) { retList.add((T) s.data); @@ -70,6 +68,10 @@ public class InMemorySnapshotStore extends SnapshotStore { return retList; } + public static void clearSnapshotsFor(final String persistenceId) { + snapshots.remove(persistenceId); + } + public static void clear() { snapshots.clear(); }