import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.MoreExecutors;
import java.util.AbstractMap.SimpleImmutableEntry;
import java.util.Map.Entry;
import java.util.concurrent.CancellationException;
public void onFailure(final Throwable t) {
transactionFailed(tx, t);
}
- });
+ }, MoreExecutors.directExecutor());
}
/*
* @param tx Backend shared transaction
* @param frontendTx
* @param isOpen indicator whether the transaction was already closed
- * @return True if cancellation succeeded, false otherwise
*/
synchronized void cancelTransaction(final PingPongTransaction tx, final DOMDataReadWriteTransaction frontendTx) {
// Attempt to unlock the operation.
@Override
public synchronized void close() {
final PingPongTransaction notLocked = lockedTx;
- Preconditions.checkState(notLocked == null, "Attempted to close chain with outstanding transaction %s", notLocked);
+ Preconditions.checkState(notLocked == null, "Attempted to close chain with outstanding transaction %s",
+ notLocked);
// This is not reliable, but if we observe it to be null and the process has already completed,
// the backend transaction chain will throw the appropriate error.
return new DOMDataReadOnlyTransaction() {
@Override
- public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(final LogicalDatastoreType store,
- final YangInstanceIdentifier path) {
+ public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(
+ final LogicalDatastoreType store, final YangInstanceIdentifier path) {
return tx.getTransaction().read(store, path);
}