Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
CDS: Implement front-end support for local transactions
[controller.git]
/
opendaylight
/
md-sal
/
sal-distributed-datastore
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
cluster
/
datastore
/
compat
/
PreLithiumTransactionContextImpl.java
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 8b6cce6c5bd392101a6e91040a08596ac743dfe5..dc82565bc0ed9789cdb5604e4a6b8f59947d48f9 100644
(file)
--- 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,17
+10,15
@@
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 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.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;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.controller.cluster.datastore.messages.WriteData;
import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import scala.concurrent.Future;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import scala.concurrent.Future;
@@
-31,16
+29,16
@@
import scala.concurrent.Future;
*
* @author Thomas Pantelis
*/
*
* @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;
public PreLithiumTransactionContextImpl(String transactionPath, ActorSelection actor, TransactionIdentifier identifier,
private static final Logger LOG = LoggerFactory.getLogger(PreLithiumTransactionContextImpl.class);
private final String transactionPath;
public PreLithiumTransactionContextImpl(String transactionPath, ActorSelection actor, TransactionIdentifier identifier,
-
String transactionChainId, ActorContext actorContext, SchemaContext schema
Context, boolean isTxActorLocal,
+
ActorContext actor
Context, boolean isTxActorLocal,
short remoteTransactionVersion, OperationCompleter operationCompleter) {
short remoteTransactionVersion, OperationCompleter operationCompleter) {
- super(actor, identifier, transactionChainId, actorContext, schemaContext, isTxActorLocal,
- remoteTransactionVersion, operationCompleter);
+ super(actor, identifier, actorContext, isTxActorLocal, remoteTransactionVersion, operationCompleter);
this.transactionPath = transactionPath;
}
this.transactionPath = transactionPath;
}
@@
-71,7
+69,7
@@
public class PreLithiumTransactionContextImpl extends TransactionContextImpl {
}
@Override
}
@Override
- protected
String extractCohortPathFrom(ReadyTransactionReply readyTxReply
) {
+ protected
Future<ActorSelection> transformReadyReply(final Future<Object> 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
// 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
@@
-79,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
// 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
}
@Override