import akka.actor.ActorSelection;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Function;
import akka.actor.ActorSelection;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.base.Supplier;
import com.google.common.collect.Iterables;
import com.google.common.base.Preconditions;
import com.google.common.base.Supplier;
import com.google.common.collect.Iterables;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import org.opendaylight.controller.cluster.datastore.modification.WriteModification;
import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
import org.opendaylight.controller.cluster.datastore.utils.NormalizedNodeAggregator;
import org.opendaylight.controller.cluster.datastore.modification.WriteModification;
import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
import org.opendaylight.controller.cluster.datastore.utils.NormalizedNodeAggregator;
import org.opendaylight.mdsal.dom.spi.store.AbstractDOMStoreTransaction;
import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.mdsal.dom.spi.store.AbstractDOMStoreTransaction;
import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
return executeRead(shardNameFromIdentifier(path), new DataExists(path, DataStoreVersions.CURRENT_VERSION));
}
return executeRead(shardNameFromIdentifier(path), new DataExists(path, DataStoreVersions.CURRENT_VERSION));
}
- private <T> CheckedFuture<T, ReadFailedException> executeRead(final String shardName,
- final AbstractRead<T> readCmd) {
+ private <T> FluentFuture<T> executeRead(final String shardName, final AbstractRead<T> readCmd) {
Preconditions.checkState(type != TransactionType.WRITE_ONLY,
"Reads from write-only transactions are not allowed");
Preconditions.checkState(type != TransactionType.WRITE_ONLY,
"Reads from write-only transactions are not allowed");
Preconditions.checkState(type != TransactionType.WRITE_ONLY,
"Reads from write-only transactions are not allowed");
Preconditions.checkNotNull(path, "path should not be null");
Preconditions.checkState(type != TransactionType.WRITE_ONLY,
"Reads from write-only transactions are not allowed");
Preconditions.checkNotNull(path, "path should not be null");
final String shardName, final YangInstanceIdentifier path) {
return executeRead(shardName, new ReadData(path, DataStoreVersions.CURRENT_VERSION));
}
final String shardName, final YangInstanceIdentifier path) {
return executeRead(shardName, new ReadData(path, DataStoreVersions.CURRENT_VERSION));
}
- final Collection<CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException>> futures =
- new ArrayList<>(allShardNames.size());
+ final Collection<FluentFuture<Optional<NormalizedNode<?, ?>>>> futures = new ArrayList<>(allShardNames.size());
for (String shardName : allShardNames) {
futures.add(singleShardRead(shardName, YangInstanceIdentifier.EMPTY));
for (String shardName : allShardNames) {
futures.add(singleShardRead(shardName, YangInstanceIdentifier.EMPTY));
private AbstractThreePhaseCommitCohort<ActorSelection> createMultiCommitCohort() {
final List<ThreePhaseCommitCohortProxy.CohortInfo> cohorts = new ArrayList<>(txContextWrappers.size());
private AbstractThreePhaseCommitCohort<ActorSelection> createMultiCommitCohort() {
final List<ThreePhaseCommitCohortProxy.CohortInfo> cohorts = new ArrayList<>(txContextWrappers.size());
for (Entry<String, TransactionContextWrapper> e : txContextWrappers.entrySet()) {
LOG.debug("Tx {} Readying transaction for shard {}", getIdentifier(), e.getKey());
for (Entry<String, TransactionContextWrapper> e : txContextWrappers.entrySet()) {
LOG.debug("Tx {} Readying transaction for shard {}", getIdentifier(), e.getKey());