X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FRemoteTransactionContextSupport.java;h=4ce0767d1df7906e2b6bbeb82e787b2ac6e17772;hp=88c797a99074c366b63a703cc583f64c1608d310;hb=28b2fd303b8e8bc757de6ead454ae06469113b34;hpb=196fbf9b716ea26740195fd397c1b2550f656638 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 88c797a990..4ce0767d1d 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 @@ -14,7 +14,6 @@ import akka.pattern.AskTimeoutException; import akka.util.Timeout; import com.google.common.base.Preconditions; import java.util.concurrent.TimeUnit; -import org.opendaylight.controller.cluster.datastore.compat.PreLithiumTransactionContextImpl; import org.opendaylight.controller.cluster.datastore.exceptions.NoShardLeaderException; import org.opendaylight.controller.cluster.datastore.exceptions.ShardLeaderNotRespondingException; import org.opendaylight.controller.cluster.datastore.identifiers.TransactionIdentifier; @@ -101,7 +100,7 @@ final class RemoteTransactionContextSupport { void setPrimaryShard(ActorSelection primaryShard, short primaryVersion) { this.primaryShard = primaryShard; - if (getTransactionType() == TransactionType.WRITE_ONLY && primaryVersion >= DataStoreVersions.LITHIUM_VERSION && + if (getTransactionType() == TransactionType.WRITE_ONLY && getActorContext().getDatastoreContext().isWriteOnlyTransactionOptimizationsEnabled()) { LOG.debug("Tx {} Primary shard {} found - creating WRITE_ONLY transaction context", getIdentifier(), primaryShard); @@ -249,15 +248,9 @@ final class RemoteTransactionContextSupport { // TxActor is always created where the leader of the shard is. // Check if TxActor is created in the same node boolean isTxActorLocal = getActorContext().isPathLocal(transactionPath); - final TransactionContext ret; - - if (remoteTransactionVersion < DataStoreVersions.LITHIUM_VERSION) { - ret = new PreLithiumTransactionContextImpl(transactionContextWrapper.getIdentifier(), transactionPath, transactionActor, - getActorContext(), isTxActorLocal, remoteTransactionVersion, transactionContextWrapper.getLimiter()); - } else { - ret = new RemoteTransactionContext(transactionContextWrapper.getIdentifier(), transactionActor, getActorContext(), - isTxActorLocal, remoteTransactionVersion, transactionContextWrapper.getLimiter()); - } + final TransactionContext ret = new RemoteTransactionContext(transactionContextWrapper.getIdentifier(), + transactionActor, getActorContext(), isTxActorLocal, remoteTransactionVersion, + transactionContextWrapper.getLimiter()); if(parent.getType() == TransactionType.READ_ONLY) { TransactionContextCleanup.track(this, ret);