Added support for multiple data store types to DOM transaction chains and to simple... 99/31399/5
authorJan Medved <jmedved@cisco.com>
Wed, 16 Dec 2015 05:34:58 +0000 (21:34 -0800)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 5 Jan 2016 09:45:01 +0000 (09:45 +0000)
Fixed a build break introduced by rebase

Change-Id: Id8cbaeed5e54d0e275adadaa79d4eddb8fcc58eb
Signed-off-by: Jan Medved <jmedved@cisco.com>
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/DatastoreAbstractWriter.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/simpletx/SimpletxBaWrite.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/simpletx/SimpletxDomWrite.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainDomWrite.java

index db17cdb..20024e4 100644 (file)
@@ -62,7 +62,7 @@ public abstract class DatastoreAbstractWriter {
         }
         else
         {
-            if (rn.nextInt() % 2 != 0) {
+            if (rn.nextBoolean() == true) {
                 dsType = LogicalDatastoreType.OPERATIONAL;
             } else {
                 dsType = LogicalDatastoreType.CONFIGURATION;
index 5357311..f0a0ba8 100644 (file)
@@ -44,15 +44,17 @@ public class SimpletxBaWrite extends DatastoreAbstractWriter {
     @Override
     public void executeList() {
         WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
+        LogicalDatastoreType dsType = getDataStoreType();
+
         long writeCnt = 0;
 
         for (OuterList element : this.list) {
             InstanceIdentifier<OuterList> iid = InstanceIdentifier.create(TestExec.class)
                                                     .child(OuterList.class, element.getKey());
             if (oper == StartTestInput.Operation.PUT) {
-                tx.put(LogicalDatastoreType.CONFIGURATION, iid, element);
+                tx.put(dsType, iid, element);
             } else {
-                tx.merge(LogicalDatastoreType.CONFIGURATION, iid, element);
+                tx.merge(dsType, iid, element);
             }
 
             writeCnt++;
@@ -66,6 +68,8 @@ public class SimpletxBaWrite extends DatastoreAbstractWriter {
                     txError++;
                 }
                 tx = dataBroker.newWriteOnlyTransaction();
+                dsType = getDataStoreType();
+
                 writeCnt = 0;
             }
         }
index f367b83..6ab6990 100644 (file)
@@ -46,6 +46,7 @@ public class SimpletxDomWrite extends DatastoreAbstractWriter {
     @Override
     public void executeList() {
         DOMDataWriteTransaction tx = domDataBroker.newWriteOnlyTransaction();
+        LogicalDatastoreType dsType = getDataStoreType();
         long writeCnt = 0;
 
         YangInstanceIdentifier pid = YangInstanceIdentifier.builder().node(TestExec.QNAME).node(OuterList.QNAME).build();
@@ -53,9 +54,9 @@ public class SimpletxDomWrite extends DatastoreAbstractWriter {
             YangInstanceIdentifier yid = pid.node(new NodeIdentifierWithPredicates(OuterList.QNAME, element.getIdentifier().getKeyValues()));
 
             if (oper == StartTestInput.Operation.PUT) {
-                tx.put(LogicalDatastoreType.CONFIGURATION, yid, element);
+                tx.put(dsType, yid, element);
             } else {
-                tx.merge(LogicalDatastoreType.CONFIGURATION, yid, element);
+                tx.merge(dsType, yid, element);
             }
 
             writeCnt++;
@@ -69,6 +70,7 @@ public class SimpletxDomWrite extends DatastoreAbstractWriter {
                     txError++;
                 }
                 tx = domDataBroker.newWriteOnlyTransaction();
+                dsType = getDataStoreType();
                 writeCnt = 0;
             }
         }
index 97d9222..7e8c6aa 100644 (file)
@@ -71,6 +71,7 @@ public class TxchainDomWrite extends DatastoreAbstractWriter implements Transact
 
             writeCnt++;
 
+            // Start performing the operation; submit the transaction at every n-th operation
             if (writeCnt == writesPerTx) {
                 txSubmitted++;
                 Futures.addCallback(tx.submit(), new FutureCallback<Void>() {

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.