import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.Collections;
+import java.util.concurrent.ExecutionException;
import java.util.concurrent.atomic.AtomicReference;
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.controller.md.sal.dom.api.DOMDataBroker;
import org.opendaylight.dsbenchmark.listener.DsbenchmarkListenerProvider;
import org.opendaylight.dsbenchmark.simpletx.SimpletxBaDelete;
tx.put(LogicalDatastoreType.OPERATIONAL, TEST_STATUS_IID, status);
try {
- tx.submit().checkedGet();
- } catch (final TransactionCommitFailedException e) {
+ tx.commit().get();
+ } catch (final InterruptedException | ExecutionException e) {
throw new IllegalStateException(e);
}
WriteTransaction tx = simpleTxDataBroker.newWriteOnlyTransaction();
tx.put(LogicalDatastoreType.CONFIGURATION, TEST_EXEC_IID, data);
try {
- tx.submit().checkedGet();
+ tx.commit().get();
LOG.debug("DataStore config test data cleaned up");
- } catch (final TransactionCommitFailedException e) {
+ } catch (final InterruptedException | ExecutionException e) {
LOG.info("Failed to cleanup DataStore configtest data");
throw new IllegalStateException(e);
}
tx = simpleTxDataBroker.newWriteOnlyTransaction();
tx.put(LogicalDatastoreType.OPERATIONAL, TEST_EXEC_IID, data);
try {
- tx.submit().checkedGet();
+ tx.commit().get();
LOG.debug("DataStore operational test data cleaned up");
- } catch (final TransactionCommitFailedException e) {
+ } catch (final InterruptedException | ExecutionException e) {
LOG.info("Failed to cleanup DataStore operational test data");
throw new IllegalStateException(e);
}
* 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);
}
}
package org.opendaylight.dsbenchmark.simpletx;
import java.util.List;
+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.BaListBuilder;
import org.opendaylight.dsbenchmark.DatastoreAbstractWriter;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.StartTestInput;
if (writeCnt == 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 (writeCnt != 0) {
try {
- tx.submit().checkedGet();
- } catch (final TransactionCommitFailedException e) {
+ tx.commit().get();
+ } catch (final InterruptedException | ExecutionException e) {
LOG.error("Transaction failed: {}", e);
}
}
package org.opendaylight.dsbenchmark.simpletx;
+import java.util.concurrent.ExecutionException;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
import org.opendaylight.dsbenchmark.DatastoreAbstractWriter;
writeCnt++;
if (writeCnt == 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 (writeCnt != 0) {
try {
- tx.submit().checkedGet();
- } catch (final TransactionCommitFailedException e) {
+ tx.commit().get();
+ } catch (final InterruptedException | ExecutionException e) {
LOG.error("Transaction failed: {}", e);
}
}
package org.opendaylight.dsbenchmark.simpletx;
import java.util.List;
+import java.util.concurrent.ExecutionException;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
import org.opendaylight.dsbenchmark.DatastoreAbstractWriter;
if (writeCnt == 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 (writeCnt != 0) {
try {
- tx.submit().checkedGet();
- } catch (final TransactionCommitFailedException e) {
+ tx.commit().get();
+ } catch (final InterruptedException | ExecutionException e) {
LOG.error("Transaction failed", e);
}
}
-
}
-
}
package org.opendaylight.dsbenchmark.txchain;
import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.MoreExecutors;
+import java.util.concurrent.ExecutionException;
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;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionChain;
import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.dsbenchmark.DatastoreAbstractWriter;
+import org.opendaylight.mdsal.common.api.CommitInfo;
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;
if (writeCnt == writesPerTx) {
txSubmitted++;
- Futures.addCallback(tx.submit(), new FutureCallback<Void>() {
+ tx.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(final Void result) {
+ public void onSuccess(final CommitInfo result) {
txOk++;
}
LOG.error("Transaction failed, {}", t);
txError++;
}
- });
+ }, MoreExecutors.directExecutor());
tx = chain.newWriteOnlyTransaction();
writeCnt = 0;
}
if (writeCnt > 0) {
txSubmitted++;
}
- tx.submit().checkedGet();
- } catch (final TransactionCommitFailedException e) {
+ tx.commit().get();
+ } catch (final InterruptedException | ExecutionException e) {
LOG.error("Transaction failed", e);
}
try {
} catch (final IllegalStateException e) {
LOG.error("Transaction close failed,", e);
}
- LOG.debug("Transactions: submitted {}, completed {}", txSubmitted, (txOk + txError));
+ LOG.debug("Transactions: submitted {}, completed {}", txSubmitted, txOk + txError);
}
@Override
package org.opendaylight.dsbenchmark.txchain;
import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.MoreExecutors;
import java.util.List;
+import java.util.concurrent.ExecutionException;
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;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionChain;
import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.dsbenchmark.BaListBuilder;
import org.opendaylight.dsbenchmark.DatastoreAbstractWriter;
+import org.opendaylight.mdsal.common.api.CommitInfo;
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;
if (writeCnt == writesPerTx) {
txSubmitted++;
- Futures.addCallback(tx.submit(), new FutureCallback<Void>() {
+ tx.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(final Void result) {
+ public void onSuccess(final CommitInfo result) {
txOk++;
}
// We need to empty the transaction chain before closing it
try {
txSubmitted++;
- tx.submit().checkedGet();
+ tx.commit().get();
txOk++;
- } catch (final TransactionCommitFailedException e) {
+ } catch (final InterruptedException | ExecutionException e) {
LOG.error("Transaction failed", e);
txError++;
}
* 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.txchain;
import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.MoreExecutors;
+import java.util.concurrent.ExecutionException;
import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionChain;
import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
import org.opendaylight.dsbenchmark.DatastoreAbstractWriter;
+import org.opendaylight.mdsal.common.api.CommitInfo;
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;
if (writeCnt == writesPerTx) {
txSubmitted++;
- Futures.addCallback(tx.submit(), new FutureCallback<Void>() {
+ tx.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(final Void result) {
+ public void onSuccess(final CommitInfo result) {
txOk++;
}
LOG.error("Transaction failed, {}", t);
txError++;
}
- });
+ }, MoreExecutors.directExecutor());
tx = chain.newWriteOnlyTransaction();
writeCnt = 0;
}
// We need to empty the transaction chain before closing it
try {
txSubmitted++;
- tx.submit().checkedGet();
+ tx.commit().get();
txOk++;
- } catch (final TransactionCommitFailedException e) {
+ } catch (final InterruptedException | ExecutionException e) {
LOG.error("Transaction failed", e);
txError++;
}
} catch (final IllegalStateException e) {
LOG.error("Transaction close failed,", e);
}
- LOG.debug("Transactions: submitted {}, completed {}", txSubmitted, (txOk + txError));
+ LOG.debug("Transactions: submitted {}, completed {}", txSubmitted, txOk + txError);
}
@Override
package org.opendaylight.dsbenchmark.txchain;
import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.MoreExecutors;
import java.util.List;
+import java.util.concurrent.ExecutionException;
import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionChain;
import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
import org.opendaylight.dsbenchmark.DatastoreAbstractWriter;
import org.opendaylight.dsbenchmark.DomListBuilder;
+import org.opendaylight.mdsal.common.api.CommitInfo;
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;
// Start performing the operation; submit the transaction at every n-th operation
if (writeCnt == writesPerTx) {
txSubmitted++;
- Futures.addCallback(tx.submit(), new FutureCallback<Void>() {
+ tx.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(final Void result) {
+ public void onSuccess(final CommitInfo result) {
txOk++;
}
LOG.error("Transaction failed, {}", t);
txError++;
}
- });
+ }, MoreExecutors.directExecutor());
tx = chain.newWriteOnlyTransaction();
writeCnt = 0;
}
try {
txSubmitted++;
- tx.submit().checkedGet();
+ tx.commit().get();
txOk++;
- } catch (final TransactionCommitFailedException e) {
+ } catch (final InterruptedException | ExecutionException e) {
LOG.error("Transaction failed", e);
txError++;
}
LOG.error("Transaction close failed,", e);
}
- LOG.debug("Transactions: submitted {}, completed {}", txSubmitted, (txOk + txError));
+ LOG.debug("Transactions: submitted {}, completed {}", txSubmitted, txOk + txError);
}
@Override
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
-import com.google.common.base.Function;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
final YangInstanceIdentifier path) {
checkState(root != null,
"A modify operation (put, merge or delete) must be performed prior to an exists operation");
- return Futures.makeChecked(Futures.transform(read(store, path),
- (Function<Optional<NormalizedNode<?, ?>>, Boolean>)
- Optional::isPresent),
- ReadFailedException.MAPPER);
+ return Futures.makeChecked(Futures.transform(read(store, path), Optional::isPresent,
+ MoreExecutors.directExecutor()), ReadFailedException.MAPPER);
}
@Override
List<ListenableFuture<?>> allFutures = measure(txNum + " Submits", () -> {
List<ListenableFuture<?>> builder = new ArrayList<>(txNum);
for (DOMDataReadWriteTransaction tx : transactions) {
- builder.add(tx.submit());
+ builder.add(tx.commit());
}
return builder;
});
});
measure("Txs:1 Submit, Finish", (Callable<Void>) () -> {
- measure("Txs:1 Submit", (Callable<ListenableFuture<?>>) writeTx::submit).get();
+ measure("Txs:1 Submit", (Callable<ListenableFuture<?>>) writeTx::commit).get();
return null;
});
}
import java.util.Collection;
import java.util.List;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import org.junit.Test;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitDeadlockException;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.controller.md.sal.dom.api.DOMDataBrokerExtension;
import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeChangeListener;
import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeChangeService;
final DOMDataWriteTransaction writeTx = domBroker.newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, TestModel.TEST_PATH, TEST_CONTAINER);
- writeTx.submit();
+ writeTx.commit();
latch.await(5, TimeUnit.SECONDS);
}
@Test
- public void replaceContainerContainerInTreeTest() throws InterruptedException, TransactionCommitFailedException {
+ public void replaceContainerContainerInTreeTest() throws InterruptedException, ExecutionException {
final CountDownLatch latch = new CountDownLatch(2);
DOMDataTreeChangeService dataTreeChangeService = getDOMDataTreeChangeService();
DOMDataWriteTransaction writeTx = domBroker.newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, TestModel.TEST_PATH, TEST_CONTAINER);
- writeTx.submit().checkedGet();
+ writeTx.commit().get();
final TestDataTreeListener listener = new TestDataTreeListener(latch);
final ListenerRegistration<TestDataTreeListener> listenerReg = dataTreeChangeService
.registerDataTreeChangeListener(ROOT_DATA_TREE_ID, listener);
writeTx = domBroker.newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, TestModel.TEST_PATH, TEST_CONTAINER_2);
- writeTx.submit();
+ writeTx.commit();
latch.await(5, TimeUnit.SECONDS);
}
@Test
- public void deleteContainerContainerInTreeTest() throws InterruptedException, TransactionCommitFailedException {
+ public void deleteContainerContainerInTreeTest() throws InterruptedException, ExecutionException {
final CountDownLatch latch = new CountDownLatch(2);
DOMDataTreeChangeService dataTreeChangeService = getDOMDataTreeChangeService();
DOMDataWriteTransaction writeTx = domBroker.newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, TestModel.TEST_PATH, TEST_CONTAINER);
- writeTx.submit().checkedGet();
+ writeTx.commit().get();
final TestDataTreeListener listener = new TestDataTreeListener(latch);
final ListenerRegistration<TestDataTreeListener> listenerReg = dataTreeChangeService
writeTx = domBroker.newWriteOnlyTransaction();
writeTx.delete(LogicalDatastoreType.CONFIGURATION, TestModel.TEST_PATH);
- writeTx.submit();
+ writeTx.commit();
latch.await(5, TimeUnit.SECONDS);
}
@Test
- public void replaceChildListContainerInTreeTest() throws InterruptedException, TransactionCommitFailedException {
+ public void replaceChildListContainerInTreeTest() throws InterruptedException, ExecutionException {
final CountDownLatch latch = new CountDownLatch(2);
DOMDataTreeChangeService dataTreeChangeService = getDOMDataTreeChangeService();
DOMDataWriteTransaction writeTx = domBroker.newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, TestModel.TEST_PATH, TEST_CONTAINER);
- writeTx.submit().checkedGet();
+ writeTx.commit().get();
final TestDataTreeListener listener = new TestDataTreeListener(latch);
final ListenerRegistration<TestDataTreeListener> listenerReg = dataTreeChangeService
writeTx = domBroker.newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, TestModel.OUTER_LIST_PATH, OUTER_LIST_2);
- writeTx.submit();
+ writeTx.commit();
latch.await(5, TimeUnit.SECONDS);
}
@Test
- public void rootModificationChildListenerTest() throws InterruptedException, TransactionCommitFailedException {
+ public void rootModificationChildListenerTest() throws InterruptedException, ExecutionException {
final CountDownLatch latch = new CountDownLatch(2);
DOMDataTreeChangeService dataTreeChangeService = getDOMDataTreeChangeService();
DOMDataWriteTransaction writeTx = domBroker.newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, TestModel.TEST_PATH, TEST_CONTAINER);
- writeTx.submit().checkedGet();
+ writeTx.commit().get();
final TestDataTreeListener listener = new TestDataTreeListener(latch);
final ListenerRegistration<TestDataTreeListener> listenerReg = dataTreeChangeService
writeTx = domBroker.newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, TestModel.TEST_PATH, TEST_CONTAINER_2);
- writeTx.submit().checkedGet();
+ writeTx.commit().get();
latch.await(1, TimeUnit.SECONDS);
}
@Test
- public void listEntryChangeNonRootRegistrationTest() throws InterruptedException, TransactionCommitFailedException {
+ public void listEntryChangeNonRootRegistrationTest() throws InterruptedException, ExecutionException {
final CountDownLatch latch = new CountDownLatch(2);
DOMDataTreeChangeService dataTreeChangeService = getDOMDataTreeChangeService();
DOMDataWriteTransaction writeTx = domBroker.newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, TestModel.TEST_PATH, TEST_CONTAINER);
- writeTx.submit().checkedGet();
+ writeTx.commit().get();
final TestDataTreeListener listener = new TestDataTreeListener(latch);
final ListenerRegistration<TestDataTreeListener> listenerReg = dataTreeChangeService
outerListEntry2);
writeTx.put(LogicalDatastoreType.CONFIGURATION, TestModel.OUTER_LIST_PATH.node(outerListEntryId3),
outerListEntry3);
- writeTx.submit();
+ writeTx.commit();
latch.await(5, TimeUnit.SECONDS);
* First transaction is marked as ready, we are able to allocate chained
* transactions.
*/
- ListenableFuture<Void> firstWriteTxFuture = firstTx.submit();
+ ListenableFuture<?> firstWriteTxFuture = firstTx.commit();
/**
* We alocate chained transaction - read transaction.
/**
* third transaction is sealed and commited.
*/
- ListenableFuture<Void> thirdDeleteTxFuture = thirdDeleteTx.submit();
+ ListenableFuture<?> thirdDeleteTxFuture = thirdDeleteTx.commit();
assertCommitSuccessful(thirdDeleteTxFuture);
/**
return tx;
}
- private static DOMDataReadWriteTransaction allocateAndWrite(
- final DOMTransactionChain txChain) throws InterruptedException, ExecutionException {
+ private static DOMDataReadWriteTransaction allocateAndWrite(final DOMTransactionChain txChain)
+ throws InterruptedException, ExecutionException {
DOMDataReadWriteTransaction tx = txChain.newReadWriteTransaction();
assertTestContainerWrite(tx);
return tx;
}
- private static void assertCommitSuccessful(
- final ListenableFuture<Void> future) throws InterruptedException, ExecutionException {
+ private static void assertCommitSuccessful(final ListenableFuture<?> future)
+ throws InterruptedException, ExecutionException {
future.get();
}
- private static void assertTestContainerExists(
- final DOMDataReadTransaction readTx) throws InterruptedException, ExecutionException {
+ private static void assertTestContainerExists(final DOMDataReadTransaction readTx)
+ throws InterruptedException, ExecutionException {
ListenableFuture<Optional<NormalizedNode<?, ?>>> readFuture = readTx.read(OPERATIONAL, TestModel.TEST_PATH);
Optional<NormalizedNode<?, ?>> readedData = readFuture.get();
assertTrue(readedData.isPresent());
}
- private static void assertTestContainerWrite(
- final DOMDataReadWriteTransaction tx) throws InterruptedException, ExecutionException {
+ private static void assertTestContainerWrite(final DOMDataReadWriteTransaction tx)
+ throws InterruptedException, ExecutionException {
tx.put(OPERATIONAL, TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME));
assertTestContainerExists(tx);
}