Migrate to MD-SAL APIs
[controller.git] / opendaylight / md-sal / benchmark-data-store / src / main / java / org / opendaylight / controller / md / sal / dom / store / benchmark / AbstractInMemoryBrokerWriteTransactionBenchmark.java
index 04298a6..c9836de 100644 (file)
@@ -8,10 +8,9 @@
 package org.opendaylight.controller.md.sal.dom.store.benchmark;
 
 import java.util.concurrent.TimeUnit;
-
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
-import org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroker;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadWriteTransaction;
+import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.openjdk.jmh.annotations.Benchmark;
 import org.openjdk.jmh.annotations.Measurement;
@@ -29,10 +28,10 @@ public abstract class AbstractInMemoryBrokerWriteTransactionBenchmark
 
     protected void initTestNode() throws Exception {
         final YangInstanceIdentifier testPath = YangInstanceIdentifier.builder(BenchmarkModel.TEST_PATH).build();
-        DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
+        DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
         writeTx.put(LogicalDatastoreType.OPERATIONAL, testPath, provideOuterListNode());
 
-        writeTx.submit().get();
+        writeTx.commit().get();
     }
 
     @Benchmark
@@ -40,13 +39,13 @@ public abstract class AbstractInMemoryBrokerWriteTransactionBenchmark
     @Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
     public void write100KSingleNodeWithOneInnerItemInOneCommitBenchmark() throws Exception {
 
-        DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
+        DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
         for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) {
             writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_100K_PATHS[outerListKey],
                     OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]);
         }
 
-        writeTx.submit().get();
+        writeTx.commit().get();
     }
 
     @Benchmark
@@ -54,11 +53,11 @@ public abstract class AbstractInMemoryBrokerWriteTransactionBenchmark
     @Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
     public void write100KSingleNodeWithOneInnerItemInCommitPerWriteBenchmark() throws Exception {
         for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) {
-            DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
+            DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
             writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_100K_PATHS[outerListKey],
                     OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]);
 
-            writeTx.submit().get();
+            writeTx.commit().get();
         }
     }
 
@@ -66,13 +65,13 @@ public abstract class AbstractInMemoryBrokerWriteTransactionBenchmark
     @Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
     @Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
     public void write50KSingleNodeWithTwoInnerItemsInOneCommitBenchmark() throws Exception {
-        DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
+        DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
         for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) {
             writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_50K_PATHS[outerListKey],
                     OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]);
         }
 
-        writeTx.submit().get();
+        writeTx.commit().get();
     }
 
     @Benchmark
@@ -80,10 +79,10 @@ public abstract class AbstractInMemoryBrokerWriteTransactionBenchmark
     @Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
     public void write50KSingleNodeWithTwoInnerItemsInCommitPerWriteBenchmark() throws Exception {
         for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) {
-            DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
+            DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
             writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_50K_PATHS[outerListKey],
                     OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]);
-            writeTx.submit().get();
+            writeTx.commit().get();
         }
     }
 
@@ -91,12 +90,12 @@ public abstract class AbstractInMemoryBrokerWriteTransactionBenchmark
     @Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
     @Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
     public void write10KSingleNodeWithTenInnerItemsInOneCommitBenchmark() throws Exception {
-        DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
+        DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
         for (int outerListKey = 0; outerListKey < OUTER_LIST_10K; ++outerListKey) {
             writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_10K_PATHS[outerListKey],
                     OUTER_LIST_TEN_ITEM_INNER_LIST[outerListKey]);
         }
-        writeTx.submit().get();
+        writeTx.commit().get();
     }
 
     @Benchmark
@@ -104,10 +103,10 @@ public abstract class AbstractInMemoryBrokerWriteTransactionBenchmark
     @Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
     public void write10KSingleNodeWithTenInnerItemsInCommitPerWriteBenchmark() throws Exception {
         for (int outerListKey = 0; outerListKey < OUTER_LIST_10K; ++outerListKey) {
-            DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
+            DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
             writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_10K_PATHS[outerListKey],
                     OUTER_LIST_TEN_ITEM_INNER_LIST[outerListKey]);
-            writeTx.submit().get();
+            writeTx.commit().get();
         }
     }
 }

©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.