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%2Fshardmanager%2FShardManagerGetSnapshotReplyActor.java;h=42ed9d09d89294d4cb645c46068c3ae2d4cb65b3;hb=55a9b9f42a14c56060f74b38f84d444c0fbfecc4;hp=21af2c49697ed65f58458816b17c467f708e703d;hpb=0f02b7edeb1454c1a568f0f1b050757e7503ddf7;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/shardmanager/ShardManagerGetSnapshotReplyActor.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/shardmanager/ShardManagerGetSnapshotReplyActor.java index 21af2c4969..42ed9d09d8 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/shardmanager/ShardManagerGetSnapshotReplyActor.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/shardmanager/ShardManagerGetSnapshotReplyActor.java @@ -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 @@ -60,12 +60,13 @@ final class ShardManagerGetSnapshotReplyActor extends UntypedAbstractActor { params.replyToActor.tell(message, getSelf()); getSelf().tell(PoisonPill.getInstance(), getSelf()); } else if (message instanceof ReceiveTimeout) { - String msg = String.format( - "Timed out after %s ms while waiting for snapshot replies from %d shard(s). %d shard(s) %s " - + "did not respond.", params.receiveTimeout.toMillis(), params.shardNames.size(), - remainingShardNames.size(), remainingShardNames); - LOG.warn("{}: {}", params.id, msg); - params.replyToActor.tell(new Failure(new TimeoutException(msg)), getSelf()); + LOG.warn("{}: Timed out after {} ms while waiting for snapshot replies from {} shard(s). " + + "{} shard(s) {} did not respond", params.id, params.receiveTimeout.toMillis(), + params.shardNames.size(), remainingShardNames.size(), remainingShardNames); + params.replyToActor.tell(new Failure(new TimeoutException(String.format( + "Timed out after %s ms while waiting for snapshot replies from %d shard(s). %d shard(s) %s " + + "did not respond.", params.receiveTimeout.toMillis(), params.shardNames.size(), + remainingShardNames.size(), remainingShardNames))), getSelf()); getSelf().tell(PoisonPill.getInstance(), getSelf()); } } @@ -89,7 +90,7 @@ final class ShardManagerGetSnapshotReplyActor extends UntypedAbstractActor { public static Props props(final Collection 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)); } @@ -100,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 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;