X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatabroker%2FClientBackedDataStore.java;h=8aebe5bb19337447dc7366d8fd86dc1eab2abf0f;hb=31316f39aecc6bad171de539292ff5d7f4743419;hp=940e5b2fbb162d9e5aa317a30b9edb48a07dfde6;hpb=28e9832cc97a345d5ceb69262784e5c8fef77e37;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/ClientBackedDataStore.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/ClientBackedDataStore.java index 940e5b2fbb..8aebe5bb19 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/ClientBackedDataStore.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/ClientBackedDataStore.java @@ -41,21 +41,29 @@ public class ClientBackedDataStore extends AbstractDataStore { @Override public DOMStoreTransactionChain createTransactionChain() { - return new ClientBackedTransactionChain(getClient().createLocalHistory()); + return new ClientBackedTransactionChain(getClient().createLocalHistory(), debugAllocation()); } @Override public DOMStoreReadTransaction newReadOnlyTransaction() { - return new ClientBackedReadTransaction(getClient().createSnapshot(), null); + return new ClientBackedReadTransaction(getClient().createSnapshot(), null, allocationContext()); } @Override public DOMStoreWriteTransaction newWriteOnlyTransaction() { - return new ClientBackedWriteTransaction(getClient().createTransaction()); + return new ClientBackedWriteTransaction(getClient().createTransaction(), allocationContext()); } @Override public DOMStoreReadWriteTransaction newReadWriteTransaction() { - return new ClientBackedReadWriteTransaction(getClient().createTransaction()); + return new ClientBackedReadWriteTransaction(getClient().createTransaction(), allocationContext()); + } + + private boolean debugAllocation() { + return getActorContext().getDatastoreContext().isTransactionDebugContextEnabled(); + } + + private Throwable allocationContext() { + return debugAllocation() ? new Throwable("allocated at") : null; } }