X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FShardSnapshotCohort.java;h=126e28d9c8c6157794f3b7a12282fb5488d5e2dd;hb=55a9b9f42a14c56060f74b38f84d444c0fbfecc4;hp=d8c49a9e744807e5089da752f02abe69e13892c7;hpb=2d60632f7cf63712e8357a3cf3fc40d83366e5e6;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardSnapshotCohort.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardSnapshotCohort.java index d8c49a9e74..126e28d9c8 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardSnapshotCohort.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardSnapshotCohort.java @@ -7,9 +7,10 @@ */ package org.opendaylight.controller.cluster.datastore; +import static java.util.Objects.requireNonNull; + import akka.actor.ActorContext; import akka.actor.ActorRef; -import com.google.common.base.Preconditions; import com.google.common.io.ByteSource; import java.io.IOException; import java.io.ObjectInputStream; @@ -43,8 +44,8 @@ final class ShardSnapshotCohort implements RaftActorSnapshotCohort { private ShardSnapshotCohort(final LocalHistoryIdentifier applyHistoryId, final ActorRef snapshotActor, final ShardDataTree store, final Logger log, final String logId) { - this.snapshotActor = Preconditions.checkNotNull(snapshotActor); - this.store = Preconditions.checkNotNull(store); + this.snapshotActor = requireNonNull(snapshotActor); + this.store = requireNonNull(store); this.log = log; this.logId = logId; } @@ -75,7 +76,7 @@ final class ShardSnapshotCohort implements RaftActorSnapshotCohort { @SuppressWarnings("checkstyle:IllegalCatch") public void applySnapshot(final Snapshot.State snapshotState) { if (!(snapshotState instanceof ShardSnapshotState)) { - log.debug("{}: applySnapshot ignoring snapshot: {}", snapshotState); + log.debug("{}: applySnapshot ignoring snapshot: {}", logId, snapshotState); } final ShardDataTreeSnapshot snapshot = ((ShardSnapshotState)snapshotState).getSnapshot(); @@ -99,7 +100,7 @@ final class ShardSnapshotCohort implements RaftActorSnapshotCohort { @Override public State deserializeSnapshot(final ByteSource snapshotBytes) throws IOException { try (ObjectInputStream in = new ObjectInputStream(snapshotBytes.openStream())) { - return new ShardSnapshotState(ShardDataTreeSnapshot.deserialize(in)); + return ShardDataTreeSnapshot.deserialize(in); } } }