Create transaction on the backend datastore only when neccessary 39/18839/3
authorMoiz Raja <moraja@cisco.com>
Wed, 22 Apr 2015 13:42:05 +0000 (06:42 -0700)
committerMoiz Raja <moraja@cisco.com>
Thu, 23 Apr 2015 16:57:15 +0000 (09:57 -0700)
commitf3e6688eb7028378ef0863171b9e9629605f3572
tree5b4f39b7ac5a73d2d7ae4414f7e6b538f9df3e11
parent0f3ae2f9e4151a60245a2b295cc7998f0d0e745f
Create transaction on the backend datastore only when neccessary

I've borrowed a bunch of code from the data broker because I needed to modify
the code for lazy transaction creation which needed me to pass around the
factories for creating the transaction on the appropriate store.

Basic tests are in place for now which ensure
that we do not create transactions on all the stores when not needed and that on
submit we only have cohorts for the transactions that we created.

The data broker still goes through the three phase commit but since now this has
been optimized with the direct commit enhancement on the datastore itself it should
not matter if we call one method or 4 as far as message passing goes. Calling the 4 methods
may result in extra object creation and such which could be avoided. I would put that in
a follow up commit.

Change-Id: Id77bb1642748e7df15e084a3f0b5e580783f2f8d
Signed-off-by: Moiz Raja <moraja@cisco.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/AbstractDOMBroker.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/AbstractDOMBrokerTransaction.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/AbstractDOMTransactionFactory.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/DOMBrokerReadOnlyTransaction.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/DOMBrokerReadWriteTransaction.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/DOMBrokerTransactionChain.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/DOMBrokerWriteOnlyTransaction.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ConcurrentDOMDataBroker.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ConcurrentDOMDataBrokerTest.java