From: Robert Varga Date: Mon, 27 Apr 2015 12:40:45 +0000 (+0200) Subject: CDS: Introduce ChainedTransactionIdentifier X-Git-Tag: release/beryllium~604 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=4b9316643d0001c8d36f6bc1ffab79f946f968e8 CDS: Introduce ChainedTransactionIdentifier Conceptually the identifier of a a transaction is an extension point, which allows passing of arbitratry, extensible identifier. It can thus be reused to track the chain identifier as well as the normal source coordinates. Introduce ChainedTransactionIdentifier to carry the transaction chain ID attached to the transaction on the frontend. This is not used in this commit directly, but rather in the follow-up patch. Change-Id: Iad24a1b59c6231e003579bb25149b73b11d6db25 Signed-off-by: Robert Varga --- diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionContextImpl.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionContextImpl.java index 63690b0d7c..b6fe2c29bd 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionContextImpl.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionContextImpl.java @@ -37,7 +37,6 @@ import scala.concurrent.Future; public class TransactionContextImpl extends AbstractTransactionContext { private static final Logger LOG = LoggerFactory.getLogger(TransactionContextImpl.class); - private final String transactionChainId; private final ActorContext actorContext; private final ActorSelection actor; private final boolean isTxActorLocal; @@ -48,11 +47,10 @@ public class TransactionContextImpl extends AbstractTransactionContext { private int totalBatchedModificationsSent; protected TransactionContextImpl(ActorSelection actor, TransactionIdentifier identifier, - String transactionChainId, ActorContext actorContext, boolean isTxActorLocal, + ActorContext actorContext, boolean isTxActorLocal, short remoteTransactionVersion, OperationCompleter operationCompleter) { super(identifier); this.actor = actor; - this.transactionChainId = transactionChainId; this.actorContext = actorContext; this.isTxActorLocal = isTxActorLocal; this.remoteTransactionVersion = remoteTransactionVersion; @@ -141,7 +139,7 @@ public class TransactionContextImpl extends AbstractTransactionContext { } private BatchedModifications newBatchedModifications() { - return new BatchedModifications(getIdentifier().toString(), remoteTransactionVersion, transactionChainId); + return new BatchedModifications(getIdentifier().toString(), remoteTransactionVersion, getIdentifier().getChainId()); } private void batchModification(Modification modification) { diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java index 950434390d..5081c9b4f8 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java @@ -97,7 +97,6 @@ public class TransactionProxy extends AbstractDOMStoreTransaction future; @@ -504,7 +502,7 @@ public class TransactionProxy extends AbstractDOMStoreTransaction