Reduce use of deprecated methods
[controller.git] / benchmark / dsbenchmark / src / main / java / org / opendaylight / dsbenchmark / simpletx / SimpletxDomDelete.java
index 58baedb..af9ad55 100644 (file)
@@ -8,8 +8,8 @@
 
 package org.opendaylight.dsbenchmark.simpletx;
 
 
 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.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;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
 import org.opendaylight.dsbenchmark.DatastoreAbstractWriter;
@@ -67,9 +67,9 @@ public class SimpletxDomDelete extends DatastoreAbstractWriter {
             writeCnt++;
             if (writeCnt == writesPerTx) {
                 try {
             writeCnt++;
             if (writeCnt == writesPerTx) {
                 try {
-                    tx.submit().checkedGet();
+                    tx.commit().get();
                     txOk++;
                     txOk++;
-                } catch (final TransactionCommitFailedException e) {
+                } catch (final  InterruptedException | ExecutionException e) {
                     LOG.error("Transaction failed: {}", e);
                     txError++;
                 }
                     LOG.error("Transaction failed: {}", e);
                     txError++;
                 }
@@ -79,8 +79,8 @@ public class SimpletxDomDelete extends DatastoreAbstractWriter {
         }
         if (writeCnt != 0) {
             try {
         }
         if (writeCnt != 0) {
             try {
-                tx.submit().checkedGet();
-            } catch (final TransactionCommitFailedException e) {
+                tx.commit().get();
+            } catch (final InterruptedException | ExecutionException e) {
                 LOG.error("Transaction failed: {}", e);
             }
         }
                 LOG.error("Transaction failed: {}", e);
             }
         }

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