X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FRemoteTransactionContextSupport.java;h=333d11b4f05ce03e4bca41e1f7727dc5e31fe279;hb=546cd1fd100dbaa36908b22c2f422320dbd8c4b2;hp=a93d46f051bdbf29c25599bea444fcd2fde93b57;hpb=f83b2d36fdd7e953ba72492ffb684cd112aa04a6;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/RemoteTransactionContextSupport.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/RemoteTransactionContextSupport.java index a93d46f051..333d11b4f0 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/RemoteTransactionContextSupport.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/RemoteTransactionContextSupport.java @@ -8,11 +8,13 @@ */ package org.opendaylight.controller.cluster.datastore; +import static java.util.Objects.requireNonNull; + import akka.actor.ActorSelection; import akka.dispatch.OnComplete; import akka.pattern.AskTimeoutException; import akka.util.Timeout; -import com.google.common.base.Preconditions; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.util.concurrent.TimeUnit; import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier; import org.opendaylight.controller.cluster.datastore.exceptions.NoShardLeaderException; @@ -33,7 +35,7 @@ import scala.concurrent.duration.FiniteDuration; *

* The end result from a completed CreateTransaction message is a TransactionContext that is * used to perform transaction operations. Transaction operations that occur before the - * CreateTransaction completes are cache via a TransactionContextWrapper and executed once the + * CreateTransaction completes are cached via a DelayedTransactionContextWrapper and executed once the * CreateTransaction completes, successfully or not. */ final class RemoteTransactionContextSupport { @@ -57,11 +59,11 @@ final class RemoteTransactionContextSupport { private final Timeout createTxMessageTimeout; - private final TransactionContextWrapper transactionContextWrapper; + private final DelayedTransactionContextWrapper transactionContextWrapper; - RemoteTransactionContextSupport(final TransactionContextWrapper transactionContextWrapper, + RemoteTransactionContextSupport(final DelayedTransactionContextWrapper transactionContextWrapper, final TransactionProxy parent, final String shardName) { - this.parent = Preconditions.checkNotNull(parent); + this.parent = requireNonNull(parent); this.shardName = shardName; this.transactionContextWrapper = transactionContextWrapper; @@ -150,6 +152,8 @@ final class RemoteTransactionContextSupport { }, getActorUtils().getClientDispatcher()); } + @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD", + justification = "https://github.com/spotbugs/spotbugs/issues/811") private void onFindPrimaryShardComplete(final Throwable failure, final PrimaryShardInfo newPrimaryShardInfo) { if (failure == null) { this.primaryShardInfo = newPrimaryShardInfo; @@ -227,7 +231,6 @@ final class RemoteTransactionContextSupport { localTransactionContext = new NoOpTransactionContext(exception, getIdentifier()); } - transactionContextWrapper.executePriorTransactionOperations(localTransactionContext); }