* 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.simpletx;
-
+import java.util.concurrent.ExecutionException;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
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;
putCnt++;
if (putCnt == writesPerTx) {
try {
- tx.submit().checkedGet();
+ tx.commit().get();
txOk++;
- } catch (final TransactionCommitFailedException e) {
+ } catch (final InterruptedException | ExecutionException e) {
LOG.error("Transaction failed: {}", e);
txError++;
}
}
if (putCnt != 0) {
try {
- tx.submit().checkedGet();
- } catch (final TransactionCommitFailedException e) {
+ tx.commit().get();
+ } catch (final InterruptedException | ExecutionException e) {
LOG.error("Transaction failed: {}", e);
}
}