X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=benchmark%2Fdsbenchmark%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fdsbenchmark%2Fsimpletx%2FSimpletxBaDelete.java;h=be52c401fd3f37f400830d166f282a2424cda2f5;hp=cb44e8f59daaa6408cda6557dc6c0bc77c6dda8e;hb=HEAD;hpb=4cc30565511b55b07f079930932430c340df0ce5 diff --git a/benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/simpletx/SimpletxBaDelete.java b/benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/simpletx/SimpletxBaDelete.java index cb44e8f59d..be52c401fd 100644 --- a/benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/simpletx/SimpletxBaDelete.java +++ b/benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/simpletx/SimpletxBaDelete.java @@ -5,15 +5,13 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.dsbenchmark.simpletx; - -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.controller.md.sal.binding.api.WriteTransaction; -import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; -import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; +import java.util.concurrent.ExecutionException; import org.opendaylight.dsbenchmark.DatastoreAbstractWriter; +import org.opendaylight.mdsal.binding.api.DataBroker; +import org.opendaylight.mdsal.binding.api.WriteTransaction; +import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.StartTestInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.StartTestInput.DataStore; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestExec; @@ -63,10 +61,10 @@ public class SimpletxBaDelete extends DatastoreAbstractWriter { putCnt++; if (putCnt == writesPerTx) { try { - tx.submit().checkedGet(); + tx.commit().get(); txOk++; - } catch (TransactionCommitFailedException e) { - LOG.error("Transaction failed: {}", e); + } catch (final InterruptedException | ExecutionException e) { + LOG.error("Transaction failed", e); txError++; } tx = dataBroker.newWriteOnlyTransaction(); @@ -75,9 +73,9 @@ public class SimpletxBaDelete extends DatastoreAbstractWriter { } if (putCnt != 0) { try { - tx.submit().checkedGet(); - } catch (TransactionCommitFailedException e) { - LOG.error("Transaction failed: {}", e); + tx.commit().get(); + } catch (final InterruptedException | ExecutionException e) { + LOG.error("Transaction failed", e); } } }