Downgrade most info messages in benchmarks
[controller.git] / benchmark / dsbenchmark / src / main / java / org / opendaylight / dsbenchmark / txchain / TxchainBaDelete.java
index b4f6769fa3aec9051848b9e7085c238bff0d3dbb..74ba61c5346d7129c1273dea0784232835b7b4fb 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.dsbenchmark.txchain;
 
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
-
 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;
@@ -31,18 +30,18 @@ import org.slf4j.LoggerFactory;
 
 public class TxchainBaDelete extends DatastoreAbstractWriter implements TransactionChainListener {
     private static final Logger LOG = LoggerFactory.getLogger(TxchainBaDelete.class);
-    private DataBroker bindingDataBroker;
+    private final DataBroker bindingDataBroker;
 
-    public TxchainBaDelete(DataBroker bindingDataBroker, int outerListElem, int innerListElem,
-            long writesPerTx, DataStore dataStore) {
+    public TxchainBaDelete(final DataBroker bindingDataBroker, final int outerListElem, final int innerListElem,
+            final long writesPerTx, final DataStore dataStore) {
         super(StartTestInput.Operation.DELETE, outerListElem, innerListElem, writesPerTx, dataStore);
         this.bindingDataBroker = bindingDataBroker;
-        LOG.info("Created TxchainBaDelete");
+        LOG.debug("Created TxchainBaDelete");
     }
 
     @Override
     public void createList() {
-        LOG.info("TxchainBaDelete: creating data in the data store");
+        LOG.debug("TxchainBaDelete: creating data in the data store");
 
         // Dump the whole list into the data store in a single transaction
         // with <outerListElem> PUTs on the transaction
@@ -58,16 +57,17 @@ public class TxchainBaDelete extends DatastoreAbstractWriter implements Transact
 
     @Override
     public void executeList() {
-        int txSubmitted = 0;
-        int writeCnt = 0;
+        final LogicalDatastoreType dsType = getDataStoreType();
+        final BindingTransactionChain chain = bindingDataBroker.createTransactionChain(this);
 
-        BindingTransactionChain chain = bindingDataBroker.createTransactionChain(this);
         WriteTransaction tx = chain.newWriteOnlyTransaction();
+        int txSubmitted = 0;
+        int writeCnt = 0;
 
-        for (long l = 0; l < outerListElem; l++) {
+        for (int l = 0; l < outerListElem; l++) {
             InstanceIdentifier<OuterList> iid = InstanceIdentifier.create(TestExec.class)
-                                                    .child(OuterList.class, new OuterListKey((int)l));
-            tx.delete(LogicalDatastoreType.CONFIGURATION, iid);
+                                                    .child(OuterList.class, new OuterListKey(l));
+            tx.delete(dsType, iid);
 
             writeCnt++;
 
@@ -105,19 +105,19 @@ public class TxchainBaDelete extends DatastoreAbstractWriter implements Transact
         } 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 TxchainBaDelete, transaction {}, cause {}",
                 chain, transaction.getIdentifier(), cause);
     }
 
     @Override
-    public void onTransactionChainSuccessful(TransactionChain<?, ?> chain) {
-        LOG.info("TxchainBaDelete closed successfully, chain {}", chain);
+    public void onTransactionChainSuccessful(final TransactionChain<?, ?> chain) {
+        LOG.debug("TxchainBaDelete closed successfully, chain {}", chain);
     }
 
 }