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%2Fsharding%2FLookupTask.java;h=244833da005333270e51c1d1bfef3a65cb8e9b76;hb=refs%2Fchanges%2F61%2F95161%2F6;hp=ca33e31a87f3d5e882709ffa8b860e0557a7b9c6;hpb=149feb98f151186975fe42bab5853e05aafd4b51;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/LookupTask.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/LookupTask.java index ca33e31a87..244833da00 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/LookupTask.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/LookupTask.java @@ -5,25 +5,23 @@ * 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.sharding; import static akka.actor.ActorRef.noSender; import akka.actor.ActorRef; import akka.actor.Status; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; +import org.eclipse.jdt.annotation.Nullable; /** - * Base class for lookup tasks. Lookup tasks are supposed to run repeatedly - * until successful lookup or maximum retries are hit. + * Base class for lookup tasks. Lookup tasks are supposed to run repeatedly until successful lookup or maximum retries + * are hit. This class is NOT thread-safe. */ -@NotThreadSafe +@Deprecated(forRemoval = true) abstract class LookupTask implements Runnable { private final int maxRetries; private final ActorRef replyTo; - private int retries = 0; + private int retried = 0; LookupTask(final ActorRef replyTo, final int maxRetries) { this.replyTo = replyTo; @@ -32,16 +30,16 @@ abstract class LookupTask implements Runnable { abstract void reschedule(int retries); - void tryReschedule(@Nullable final Throwable throwable) { - if (retries <= maxRetries) { - retries++; - reschedule(retries); + void tryReschedule(final @Nullable Throwable throwable) { + if (retried <= maxRetries) { + retried++; + reschedule(retried); } else { fail(throwable); } } - void fail(@Nullable final Throwable throwable) { + void fail(final @Nullable Throwable throwable) { if (throwable == null) { replyTo.tell(new Status.Failure( new DOMDataTreeShardCreationFailedException("Unable to find the backend shard."