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%2FRaftActorSnapshotMessageSupport.java;h=3b4c08c405bf02dace5565602d663166e4643e3f;hp=4c723bf32730bdb5211bfdfd5f6bf1cec9edd8b5;hb=refs%2Fchanges%2F09%2F83009%2F6;hpb=917283d6f5633ad981bebb6dfc6d6e0245876ab5 diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorSnapshotMessageSupport.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorSnapshotMessageSupport.java index 4c723bf327..3b4c08c405 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorSnapshotMessageSupport.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorSnapshotMessageSupport.java @@ -14,7 +14,6 @@ import com.google.common.annotations.VisibleForTesting; import java.util.Collections; import java.util.Optional; import java.util.concurrent.TimeUnit; -import org.apache.commons.lang3.SerializationUtils; import org.opendaylight.controller.cluster.raft.base.messages.ApplySnapshot; import org.opendaylight.controller.cluster.raft.base.messages.CaptureSnapshot; import org.opendaylight.controller.cluster.raft.base.messages.CaptureSnapshotReply; @@ -23,7 +22,7 @@ import org.opendaylight.controller.cluster.raft.client.messages.GetSnapshotReply import org.opendaylight.controller.cluster.raft.persisted.EmptyState; import org.opendaylight.controller.cluster.raft.persisted.Snapshot; import org.slf4j.Logger; -import scala.concurrent.duration.Duration; +import scala.concurrent.duration.FiniteDuration; /** * Handles snapshot related messages for a RaftActor. @@ -42,7 +41,7 @@ class RaftActorSnapshotMessageSupport { private final RaftActorSnapshotCohort cohort; private final Logger log; - private Duration snapshotReplyActorTimeout = Duration.create(30, TimeUnit.SECONDS); + private FiniteDuration snapshotReplyActorTimeout = FiniteDuration.create(30, TimeUnit.SECONDS); RaftActorSnapshotMessageSupport(final RaftActorContext context, final RaftActorSnapshotCohort cohort) { this.context = context; @@ -125,13 +124,12 @@ class RaftActorSnapshotMessageSupport { context.getTermInformation().getCurrentTerm(), context.getTermInformation().getVotedFor(), context.getPeerServerInfo(true)); - sender.tell(new GetSnapshotReply(context.getId(), SerializationUtils.serialize(snapshot)), - context.getActor()); + sender.tell(new GetSnapshotReply(context.getId(), snapshot), context.getActor()); } } @VisibleForTesting - void setSnapshotReplyActorTimeout(Duration snapshotReplyActorTimeout) { + void setSnapshotReplyActorTimeout(FiniteDuration snapshotReplyActorTimeout) { this.snapshotReplyActorTimeout = snapshotReplyActorTimeout; } }