Bug 2318: Ensure previous Tx in chain is readied before creating the next 35/12535/2
authortpantelis <tpanteli@brocade.com>
Sat, 1 Nov 2014 08:10:20 +0000 (04:10 -0400)
committertpantelis <tpanteli@brocade.com>
Sat, 1 Nov 2014 22:20:21 +0000 (18:20 -0400)
commit2ce392e287211179691e9ad9c738a6776effacd8
tree1ecbe3412dab6cf1850dea4005357af18492a25b
parentdef3ed5d503108b48ad3e90e451e20b72b5dbd72
Bug 2318: Ensure previous Tx in chain is readied before creating the next

In TransactionChainProxy, subclassed TransactionProxy (ChainedTransactionProxy)
to hook into the TransactionProxy to capture the cohort Futures on ready
and to customize the returned create shard Tx Future.

The previous Tx's ready Futures are captured and cached in the enclosing
TransactionChainProxy instance. When the client creates the next Tx in
the chain, the Future from the shard Tx create message is wrapped by a
sequence Future that combines all the previous ready Futures. Thus, when
the previous ready Futures complete, the shard Tx create is sent and
that Future is used to complete the returned Promise.

Change-Id: If002e4d705510aee3f560c506318d25f386768e5
Signed-off-by: tpantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionChainProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreIntegrationTest.java