X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=benchmark%2Fdsbenchmark%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fdsbenchmark%2Ftxchain%2FTxchainDomDelete.java;h=a1efbfa2f893b337e7158159ecb04e04ee5c5483;hp=8e32897a042986f2e00fbe54ffab5f1cd79d2fcd;hb=cfd2e240178039a439001c4d3f1ca5f26097dcdd;hpb=cd184f0a4226f20838c72ac1fdaf6fa19585df3b diff --git a/benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainDomDelete.java b/benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainDomDelete.java index 8e32897a04..a1efbfa2f8 100644 --- a/benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainDomDelete.java +++ b/benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainDomDelete.java @@ -5,20 +5,20 @@ * 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.txchain; import com.google.common.util.concurrent.FutureCallback; -import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.MoreExecutors; +import java.util.concurrent.ExecutionException; import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; import org.opendaylight.controller.md.sal.common.api.data.TransactionChain; import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener; -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.controller.md.sal.dom.api.DOMTransactionChain; import org.opendaylight.dsbenchmark.DatastoreAbstractWriter; +import org.opendaylight.mdsal.common.api.CommitInfo; 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; @@ -76,9 +76,9 @@ public class TxchainDomDelete extends DatastoreAbstractWriter implements Transac if (writeCnt == writesPerTx) { txSubmitted++; - Futures.addCallback(tx.submit(), new FutureCallback() { + tx.commit().addCallback(new FutureCallback() { @Override - public void onSuccess(final Void result) { + public void onSuccess(final CommitInfo result) { txOk++; } @@ -87,7 +87,7 @@ public class TxchainDomDelete extends DatastoreAbstractWriter implements Transac LOG.error("Transaction failed, {}", t); txError++; } - }); + }, MoreExecutors.directExecutor()); tx = chain.newWriteOnlyTransaction(); writeCnt = 0; } @@ -98,9 +98,9 @@ public class TxchainDomDelete extends DatastoreAbstractWriter implements Transac // We need to empty the transaction chain before closing it try { txSubmitted++; - tx.submit().checkedGet(); + tx.commit().get(); txOk++; - } catch (final TransactionCommitFailedException e) { + } catch (final InterruptedException | ExecutionException e) { LOG.error("Transaction failed", e); txError++; } @@ -109,7 +109,7 @@ public class TxchainDomDelete extends DatastoreAbstractWriter implements Transac } catch (final IllegalStateException e) { LOG.error("Transaction close failed,", e); } - LOG.debug("Transactions: submitted {}, completed {}", txSubmitted, (txOk + txError)); + LOG.debug("Transactions: submitted {}, completed {}", txSubmitted, txOk + txError); } @Override