import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
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.TestExec;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.OuterList;
import org.opendaylight.yangtools.yang.common.QName;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
-public class TxchainDomDelete extends DatastoreAbstractWriter implements TransactionChainListener{
+public class TxchainDomDelete extends DatastoreAbstractWriter implements TransactionChainListener {
private static final Logger LOG = LoggerFactory.getLogger(TxchainBaWrite.class);
private final DOMDataBroker domDataBroker;
- public TxchainDomDelete(DOMDataBroker domDataBroker, int outerListElem, int innerListElem, long writesPerTx) {
- super(StartTestInput.Operation.DELETE, outerListElem, innerListElem, writesPerTx);
+ public TxchainDomDelete(DOMDataBroker domDataBroker, int outerListElem, int innerListElem,
+ long writesPerTx, DataStore dataStore) {
+ super(StartTestInput.Operation.DELETE, outerListElem, innerListElem, writesPerTx, dataStore);
this.domDataBroker = domDataBroker;
LOG.info("Created TxchainDomDelete");
}
StartTestInput.Operation.PUT,
outerListElem,
innerListElem,
- outerListElem);
+ outerListElem,
+ dataStore);
dd.createList();
dd.executeList();
}
int txSubmitted = 0;
int writeCnt = 0;
- org.opendaylight.yangtools.yang.common.QName OL_ID = QName.create(OuterList.QNAME, "id");
+ org.opendaylight.yangtools.yang.common.QName olId = QName.create(OuterList.QNAME, "id");
DOMTransactionChain chain = domDataBroker.createTransactionChain(this);
DOMDataWriteTransaction tx = chain.newWriteOnlyTransaction();
- YangInstanceIdentifier pid = YangInstanceIdentifier.builder().node(TestExec.QNAME).node(OuterList.QNAME).build();
+ YangInstanceIdentifier pid =
+ YangInstanceIdentifier.builder().node(TestExec.QNAME).node(OuterList.QNAME).build();
for (int l = 0; l < outerListElem; l++) {
- YangInstanceIdentifier yid = pid.node(new NodeIdentifierWithPredicates(OuterList.QNAME, OL_ID, l));
+ YangInstanceIdentifier yid = pid.node(new NodeIdentifierWithPredicates(OuterList.QNAME, olId, l));
tx.delete(LogicalDatastoreType.CONFIGURATION, yid);
writeCnt++;
public void onSuccess(final Void result) {
txOk++;
}
+
@Override
public void onFailure(final Throwable t) {
LOG.error("Transaction failed, {}", t);
}
try {
chain.close();
- }
- catch (IllegalStateException e){
+ } catch (IllegalStateException e) {
LOG.error("Transaction close failed,", e);
}
LOG.info("Transactions: submitted {}, completed {}", txSubmitted, (txOk + txError));