Require FiniteDuration in Actor props 50/78450/3
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 5 Dec 2018 10:10:42 +0000 (11:10 +0100)
committerTom Pantelis <tompantelis@gmail.com>
Wed, 5 Dec 2018 15:11:32 +0000 (15:11 +0000)
All callers are using FiniteDuration and we really do not want
to have an infinite receive timeout. Require FiniteDuration
to be specified.

Change-Id: Ia4664dd2a1fea76ee4c42641ef132d6d47c78385
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/GetSnapshotReplyActor.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/shardmanager/ShardManagerGetSnapshotReplyActor.java

index 0e8847c..a533168 100644 (file)
@@ -21,7 +21,7 @@ import org.opendaylight.controller.cluster.raft.persisted.ServerConfigurationPay
 import org.opendaylight.controller.cluster.raft.persisted.Snapshot;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import scala.concurrent.duration.Duration;
+import scala.concurrent.duration.FiniteDuration;
 
 /**
  * Temporary actor used to receive a CaptureSnapshotReply message and return a GetSnapshotReply instance.
@@ -66,7 +66,7 @@ class GetSnapshotReplyActor extends UntypedAbstractActor {
     }
 
     public static Props props(final CaptureSnapshot captureSnapshot, final ElectionTerm electionTerm,
-            final ActorRef replyToActor, final Duration receiveTimeout, final String id,
+            final ActorRef replyToActor, final FiniteDuration receiveTimeout, final String id,
             final ServerConfigurationPayload updatedPeerInfo) {
         return Props.create(GetSnapshotReplyActor.class, new Params(captureSnapshot, electionTerm, replyToActor,
                 receiveTimeout, id, updatedPeerInfo));
@@ -76,12 +76,12 @@ class GetSnapshotReplyActor extends UntypedAbstractActor {
         final CaptureSnapshot captureSnapshot;
         final ActorRef replyToActor;
         final ElectionTerm electionTerm;
-        final Duration receiveTimeout;
+        final FiniteDuration receiveTimeout;
         final String id;
         final ServerConfigurationPayload peerInformation;
 
         Params(final CaptureSnapshot captureSnapshot, final ElectionTerm electionTerm, final ActorRef replyToActor,
-                final Duration receiveTimeout, final String id, final ServerConfigurationPayload peerInfo) {
+                final FiniteDuration receiveTimeout, final String id, final ServerConfigurationPayload peerInfo) {
             this.captureSnapshot = Preconditions.checkNotNull(captureSnapshot);
             this.electionTerm = Preconditions.checkNotNull(electionTerm);
             this.replyToActor = Preconditions.checkNotNull(replyToActor);
index ed384fd..42ed9d0 100644 (file)
@@ -26,7 +26,7 @@ import org.opendaylight.controller.cluster.datastore.persisted.ShardManagerSnaps
 import org.opendaylight.controller.cluster.raft.client.messages.GetSnapshotReply;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import scala.concurrent.duration.Duration;
+import scala.concurrent.duration.FiniteDuration;
 
 /**
  * Temporary actor used by the ShardManager to compile GetSnapshot replies from the Shard actors and return
@@ -90,7 +90,7 @@ final class ShardManagerGetSnapshotReplyActor extends UntypedAbstractActor {
 
     public static Props props(final Collection<String> shardNames, final String datastoreType,
             final ShardManagerSnapshot shardManagerSnapshot, final ActorRef replyToActor, final String id,
-            final Duration receiveTimeout) {
+            final FiniteDuration receiveTimeout) {
         return Props.create(ShardManagerGetSnapshotReplyActor.class, new Params(shardNames, datastoreType,
                 shardManagerSnapshot, replyToActor, id, receiveTimeout));
     }
@@ -101,11 +101,11 @@ final class ShardManagerGetSnapshotReplyActor extends UntypedAbstractActor {
         final ShardManagerSnapshot shardManagerSnapshot;
         final ActorRef replyToActor;
         final String id;
-        final Duration receiveTimeout;
+        final FiniteDuration receiveTimeout;
 
         Params(final Collection<String> shardNames, final String datastoreType,
                 final ShardManagerSnapshot shardManagerSnapshot, final ActorRef replyToActor, final String id,
-                final Duration receiveTimeout) {
+                final FiniteDuration receiveTimeout) {
             this.shardNames = shardNames;
             this.datastoreType = datastoreType;
             this.shardManagerSnapshot = shardManagerSnapshot;

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.