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%2Fcompat%2FPreLithiumTransactionContextImpl.java;h=dc82565bc0ed9789cdb5604e4a6b8f59947d48f9;hp=249a115588b7b1f78dbd7e720c777a958f9b23b6;hb=2f7c93174d7834a4c4aedacc9b88aa53a5a0422c;hpb=864f3c5bb156a7f6f6e2d91a6c7d43e916909e84 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/compat/PreLithiumTransactionContextImpl.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/compat/PreLithiumTransactionContextImpl.java index 249a115588..dc82565bc0 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/compat/PreLithiumTransactionContextImpl.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/compat/PreLithiumTransactionContextImpl.java @@ -10,12 +10,11 @@ package org.opendaylight.controller.cluster.datastore.compat; import akka.actor.ActorSelection; import org.opendaylight.controller.cluster.datastore.DataStoreVersions; import org.opendaylight.controller.cluster.datastore.OperationCompleter; -import org.opendaylight.controller.cluster.datastore.TransactionContextImpl; +import org.opendaylight.controller.cluster.datastore.RemoteTransactionContext; import org.opendaylight.controller.cluster.datastore.identifiers.TransactionIdentifier; import org.opendaylight.controller.cluster.datastore.messages.DeleteData; import org.opendaylight.controller.cluster.datastore.messages.MergeData; import org.opendaylight.controller.cluster.datastore.messages.ReadyTransaction; -import org.opendaylight.controller.cluster.datastore.messages.ReadyTransactionReply; import org.opendaylight.controller.cluster.datastore.messages.WriteData; import org.opendaylight.controller.cluster.datastore.utils.ActorContext; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; @@ -30,7 +29,8 @@ import scala.concurrent.Future; * * @author Thomas Pantelis */ -public class PreLithiumTransactionContextImpl extends TransactionContextImpl { +@Deprecated +public class PreLithiumTransactionContextImpl extends RemoteTransactionContext { private static final Logger LOG = LoggerFactory.getLogger(PreLithiumTransactionContextImpl.class); private final String transactionPath; @@ -69,7 +69,7 @@ public class PreLithiumTransactionContextImpl extends TransactionContextImpl { } @Override - protected String extractCohortPathFrom(ReadyTransactionReply readyTxReply) { + protected Future transformReadyReply(final Future readyReplyFuture) { // In base Helium we used to return the local path of the actor which represented // a remote ThreePhaseCommitCohort. The local path would then be converted to // a remote path using this resolvePath method. To maintain compatibility with @@ -77,11 +77,11 @@ public class PreLithiumTransactionContextImpl extends TransactionContextImpl { // At some point in the future when upgrades from Helium are not supported // we could remove this code to resolvePath and just use the cohortPath as the // resolved cohortPath - if(getRemoteTransactionVersion() < DataStoreVersions.HELIUM_1_VERSION) { - return getActorContext().resolvePath(transactionPath, readyTxReply.getCohortPath()); + if (getRemoteTransactionVersion() < DataStoreVersions.HELIUM_1_VERSION) { + return PreLithiumTransactionReadyReplyMapper.transform(readyReplyFuture, getActorContext(), getIdentifier(), transactionPath); + } else { + return super.transformReadyReply(readyReplyFuture); } - - return readyTxReply.getCohortPath(); } @Override