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=8b6cce6c5bd392101a6e91040a08596ac743dfe5;hp=ccfb32969287291b941861ecaefe1c1f25df5613;hb=c6c9b43923bbe8bc6d586ce09649324949e6b092;hpb=3c82a8f501a71ec8a40b170fc7ef12f8683c1842 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 ccfb329692..8b6cce6c5b 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 @@ -15,6 +15,7 @@ import org.opendaylight.controller.cluster.datastore.identifiers.TransactionIden 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; @@ -45,36 +46,32 @@ public class PreLithiumTransactionContextImpl extends TransactionContextImpl { @Override public void deleteData(YangInstanceIdentifier path) { - recordedOperationFutures.add(executeOperationAsync( - new DeleteData(path, getRemoteTransactionVersion()))); + executeOperationAsync(new DeleteData(path, getRemoteTransactionVersion())); } @Override public void mergeData(YangInstanceIdentifier path, NormalizedNode data) { - recordedOperationFutures.add(executeOperationAsync( - new MergeData(path, data, getRemoteTransactionVersion()))); + executeOperationAsync(new MergeData(path, data, getRemoteTransactionVersion())); } @Override public void writeData(YangInstanceIdentifier path, NormalizedNode data) { - recordedOperationFutures.add(executeOperationAsync( - new WriteData(path, data, getRemoteTransactionVersion()))); + executeOperationAsync(new WriteData(path, data, getRemoteTransactionVersion())); } @Override public Future readyTransaction() { - LOG.debug("Tx {} readyTransaction called with {} previous recorded operations pending", - identifier, recordedOperationFutures.size()); + LOG.debug("Tx {} readyTransaction called", getIdentifier()); // Send the ReadyTransaction message to the Tx actor. Future lastReplyFuture = executeOperationAsync(ReadyTransaction.INSTANCE); - return combineRecordedOperationsFutures(lastReplyFuture); + return transformReadyReply(lastReplyFuture); } @Override - protected String deserializeCohortPath(String cohortPath) { + protected String extractCohortPathFrom(ReadyTransactionReply readyTxReply) { // 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 @@ -83,9 +80,19 @@ public class PreLithiumTransactionContextImpl extends TransactionContextImpl { // 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, cohortPath); + return getActorContext().resolvePath(transactionPath, readyTxReply.getCohortPath()); } - return cohortPath; + return readyTxReply.getCohortPath(); + } + + @Override + public boolean supportsDirectCommit() { + return false; + } + + @Override + public Future directCommit() { + throw new UnsupportedOperationException("directCommit is not supported for " + getClass()); } }