Reduce use of deprecated methods
[controller.git] / benchmark / dsbenchmark / src / main / java / org / opendaylight / dsbenchmark / simpletx / SimpletxDomDelete.java
index 565b2f86692e54a51b53cb94c73b55f9b40d3437..af9ad559e55a858182619dc3a74d7b7676c0eb70 100644 (file)
@@ -8,8 +8,8 @@
 
 package org.opendaylight.dsbenchmark.simpletx;
 
+import java.util.concurrent.ExecutionException;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
 import org.opendaylight.dsbenchmark.DatastoreAbstractWriter;
@@ -31,12 +31,12 @@ public class SimpletxDomDelete extends DatastoreAbstractWriter {
             final int innerListElem, final long writesPerTx, final DataStore dataStore) {
         super(StartTestInput.Operation.DELETE, outerListElem, innerListElem, writesPerTx, dataStore);
         this.domDataBroker = domDataBroker;
-        LOG.info("Created simpleTxDomDelete");
+        LOG.debug("Created simpleTxDomDelete");
     }
 
     @Override
     public void createList() {
-        LOG.info("SimpletxDomDelete: creating data in the data store");
+        LOG.debug("SimpletxDomDelete: creating data in the data store");
         // Dump the whole list into the data store in a single transaction
         // with <outerListElem> PUTs on the transaction
         SimpletxDomWrite dd = new SimpletxDomWrite(domDataBroker,
@@ -67,9 +67,9 @@ public class SimpletxDomDelete extends DatastoreAbstractWriter {
             writeCnt++;
             if (writeCnt == writesPerTx) {
                 try {
-                    tx.submit().checkedGet();
+                    tx.commit().get();
                     txOk++;
-                } catch (TransactionCommitFailedException e) {
+                } catch (final  InterruptedException | ExecutionException e) {
                     LOG.error("Transaction failed: {}", e);
                     txError++;
                 }
@@ -79,8 +79,8 @@ public class SimpletxDomDelete extends DatastoreAbstractWriter {
         }
         if (writeCnt != 0) {
             try {
-                tx.submit().checkedGet();
-            } catch (TransactionCommitFailedException e) {
+                tx.commit().get();
+            } catch (final InterruptedException | ExecutionException e) {
                 LOG.error("Transaction failed: {}", e);
             }
         }