Add exists method on DOMStoreReadTransaction and DOMDataReadTransaction
authorMoiz Raja <moraja@cisco.com>
Sun, 10 Aug 2014 23:18:33 +0000 (16:18 -0700)
committerMoiz Raja <moraja@cisco.com>
Tue, 12 Aug 2014 17:18:29 +0000 (10:18 -0700)
commitf561778bcc11c3573158702356781523397b8215
tree28574004fd0399e6bfedf7ff13728ab931feb801
parent15bbaee0befd1a7615b0f3c81189e280337de21f
Add exists method on DOMStoreReadTransaction and DOMDataReadTransaction

Introducing this API does not impact clients as it is mostly internal.

One reason for adding this API is because of ensureParentsByMerge used in a couple of places
which keeps checking if a parent node exists by reading a node to figure out if it exists. This is
fine for the InMemoryDataStore but it can be terrible in a distributed data store where the shard
which contains the data is remote. All sorts of overhead is associated with a remote read including
serialization which can actually be pretty expensive.

Change-Id: Ib5be5f6dc60be683d7a04c81dad08c56cd5681f4
Signed-off-by: Moiz Raja <moraja@cisco.com>
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/BrokerFacade.java
opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/BrokerFacadeTest.java