Bug 4774: Wait for prior RO tx creates on tx chain 18/31318/5
authorTom Pantelis <tpanteli@brocade.com>
Mon, 14 Dec 2015 23:27:10 +0000 (18:27 -0500)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 17 Dec 2015 14:04:02 +0000 (14:04 +0000)
commit86a3188d6db1e7da2803a6b36daa2898fe045e45
tree0d73893ca39e280fa1f742b09b5fb95f4bf0f3be
parente89e30d5b3f4a8012f0fa236842fddaea453a4b8
Bug 4774: Wait for prior RO tx creates on tx chain

Added a priorReadOnlyTxPromises map to TransactionChainProxy that holds
Promise instances for each read-only tx. When the parent class completes
the primary shard lookup and creates the TransactionContext (either success or
failure), onTransactionContextCreated is called which completes the Promise. A
write tx that is created prior to completion will wait on the Promise's Future via
findPrimaryShard.

Change-Id: Ib1a620cfd5be3e38f633b3faf9ef7a31abaaf345
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractTransactionContextFactory.java
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/TransactionContextFactory.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreIntegrationTest.java