Allow DataObjectModification to address grouping nodes
[controller.git] / benchmark / dsbenchmark / src / main / java / org / opendaylight / dsbenchmark / simpletx / SimpletxBaDelete.java
index 4d67d4c90a7e99c9bd1d2407182ea1a407741eb6..a165ea0a03b442f1708a0fdecb2a79d403dd49c0 100644 (file)
@@ -25,18 +25,18 @@ import org.slf4j.LoggerFactory;
 
 public class SimpletxBaDelete extends DatastoreAbstractWriter {
     private static final Logger LOG = LoggerFactory.getLogger(SimpletxBaDelete.class);
-    private DataBroker dataBroker;
+    private final DataBroker dataBroker;
 
-    public SimpletxBaDelete(DataBroker dataBroker, int outerListElem, int innerListElem,
-            long writesPerTx, DataStore dataStore) {
+    public SimpletxBaDelete(final DataBroker dataBroker, final int outerListElem, final int innerListElem,
+            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 <outerListElem> PUTs on the transaction
         SimpletxBaWrite dd = new SimpletxBaWrite(dataBroker,
@@ -51,19 +51,21 @@ public class SimpletxBaDelete extends DatastoreAbstractWriter {
 
     @Override
     public void executeList() {
+        final LogicalDatastoreType dsType = getDataStoreType();
+
         WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
         long putCnt = 0;
 
         for (long l = 0; l < outerListElem; l++) {
             InstanceIdentifier<OuterList> iid = InstanceIdentifier.create(TestExec.class)
                                                         .child(OuterList.class, new OuterListKey((int)l));
-            tx.delete(LogicalDatastoreType.CONFIGURATION, iid);
+            tx.delete(dsType, iid);
             putCnt++;
             if (putCnt == writesPerTx) {
                 try {
                     tx.submit().checkedGet();
                     txOk++;
-                } catch (TransactionCommitFailedException e) {
+                } catch (final TransactionCommitFailedException e) {
                     LOG.error("Transaction failed: {}", e);
                     txError++;
                 }
@@ -74,7 +76,7 @@ public class SimpletxBaDelete extends DatastoreAbstractWriter {
         if (putCnt != 0) {
             try {
                 tx.submit().checkedGet();
-            } catch (TransactionCommitFailedException e) {
+            } catch (final TransactionCommitFailedException e) {
                 LOG.error("Transaction failed: {}", e);
             }
         }