X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=benchmark%2Fdsbenchmark%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fdsbenchmark%2Ftxchain%2FTxchainBaWrite.java;h=e17ef9827e102c49b6444441b88aba9ba03b5bae;hb=4cc30565511b55b07f079930932430c340df0ce5;hp=962c95037ff09f1d5be741220dab30c474721eac;hpb=625723b875800d5c421061f09cd5f387ccb59e62;p=controller.git diff --git a/benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainBaWrite.java b/benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainBaWrite.java index 962c95037f..e17ef9827e 100644 --- a/benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainBaWrite.java +++ b/benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainBaWrite.java @@ -10,9 +10,7 @@ package org.opendaylight.dsbenchmark.txchain; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; - import java.util.List; - import org.opendaylight.controller.md.sal.binding.api.BindingTransactionChain; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.WriteTransaction; @@ -23,9 +21,9 @@ import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListen import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; import org.opendaylight.dsbenchmark.BaListBuilder; import org.opendaylight.dsbenchmark.DatastoreAbstractWriter; +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.StartTestInput.Operation; -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.TestExec; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.OuterList; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; @@ -37,11 +35,11 @@ public class TxchainBaWrite extends DatastoreAbstractWriter implements Transacti private final DataBroker bindingDataBroker; private List list; - public TxchainBaWrite(DataBroker bindingDataBroker, Operation oper, - int outerListElem, int innerListElem, long writesPerTx, DataStore dataStore) { + public TxchainBaWrite(final DataBroker bindingDataBroker, final Operation oper, + final int outerListElem, final int innerListElem, final long writesPerTx, final DataStore dataStore) { super(oper, outerListElem, innerListElem, writesPerTx, dataStore); this.bindingDataBroker = bindingDataBroker; - LOG.info("Created TxchainBaWrite"); + LOG.debug("Created TxchainBaWrite"); } @Override @@ -51,12 +49,12 @@ public class TxchainBaWrite extends DatastoreAbstractWriter implements Transacti @Override public void executeList() { - int txSubmitted = 0; - int writeCnt = 0; + final BindingTransactionChain chain = bindingDataBroker.createTransactionChain(this); + final LogicalDatastoreType dsType = getDataStoreType(); - BindingTransactionChain chain = bindingDataBroker.createTransactionChain(this); WriteTransaction tx = chain.newWriteOnlyTransaction(); - LogicalDatastoreType dsType = getDataStoreType(); + int txSubmitted = 0; + int writeCnt = 0; for (OuterList element : this.list) { InstanceIdentifier iid = InstanceIdentifier.create(TestExec.class) @@ -85,7 +83,6 @@ public class TxchainBaWrite extends DatastoreAbstractWriter implements Transacti } }); tx = chain.newWriteOnlyTransaction(); - dsType = getDataStoreType(); writeCnt = 0; } } @@ -106,19 +103,19 @@ public class TxchainBaWrite extends DatastoreAbstractWriter implements Transacti } catch (IllegalStateException e) { LOG.error("Transaction close failed,", e); } - LOG.info("Transactions: submitted {}, completed {}", txSubmitted, (txOk + txError)); + LOG.debug("Transactions: submitted {}, completed {}", txSubmitted, (txOk + txError)); } @Override - public void onTransactionChainFailed(TransactionChain chain, - AsyncTransaction transaction, Throwable cause) { + public void onTransactionChainFailed(final TransactionChain chain, + final AsyncTransaction transaction, final Throwable cause) { LOG.error("Broken chain {} in DatastoreBaAbstractWrite, transaction {}, cause {}", chain, transaction.getIdentifier(), cause); } @Override - public void onTransactionChainSuccessful(TransactionChain chain) { - LOG.info("DatastoreBaAbstractWrite closed successfully, chain {}", chain); + public void onTransactionChainSuccessful(final TransactionChain chain) { + LOG.debug("DatastoreBaAbstractWrite closed successfully, chain {}", chain); } } \ No newline at end of file