Added support for multiple data store types to DOM transaction chains and to simple...
[controller.git] / benchmark / dsbenchmark / src / main / java / org / opendaylight / dsbenchmark / simpletx / SimpletxBaWrite.java
index 5357311e40a8704906f3aa33c10ef9a9458dab64..f0a0ba895a1a3bfead70beb78f4d613250ca63d3 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;
             }
         }