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=f41cb1f50e6d5c494ef1d5a9a7d296a9cf7fb2f1;hp=a96d0d56f7c2fdc462ac5d33adaccbb57e2dc994;hb=793318ca32e9180614b68625eebb7dad902bf120;hpb=9ad9f0d0b72c07316c6282995b7f11abf57041c3 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 a96d0d56f7..f41cb1f50e 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; @@ -31,12 +29,12 @@ public class SimpletxBaDelete extends DatastoreAbstractWriter { final long writesPerTx, final DataStore dataStore) { super(StartTestInput.Operation.DELETE, outerListElem, innerListElem, writesPerTx, dataStore); this.dataBroker = dataBroker; - LOG.info("Created SimpletxBaDelete"); + LOG.debug("Created SimpletxBaDelete"); } @Override public void createList() { - LOG.info("DatastoreDelete: creating data in the data store"); + LOG.debug("DatastoreDelete: creating data in the data store"); // Dump the whole list into the data store in a single transaction // with PUTs on the transaction SimpletxBaWrite dd = new SimpletxBaWrite(dataBroker, @@ -63,9 +61,9 @@ public class SimpletxBaDelete extends DatastoreAbstractWriter { putCnt++; if (putCnt == writesPerTx) { try { - tx.submit().checkedGet(); + tx.commit().get(); txOk++; - } catch (TransactionCommitFailedException e) { + } catch (final InterruptedException | ExecutionException e) { LOG.error("Transaction failed: {}", e); txError++; } @@ -75,8 +73,8 @@ public class SimpletxBaDelete extends DatastoreAbstractWriter { } if (putCnt != 0) { try { - tx.submit().checkedGet(); - } catch (TransactionCommitFailedException e) { + tx.commit().get(); + } catch (final InterruptedException | ExecutionException e) { LOG.error("Transaction failed: {}", e); } }