X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FTransactionProxy.java;h=019b0dbebe20c18f964b6f8c5f0f385bf59d3a76;hb=33877f41ffc3f8eb36ad8490315419b90817d26e;hp=155bb1fd3e303cfe8aa929fb44322bad90e2e949;hpb=3859df9beca8f13f1ff2b2744ed3470a1715bec3;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java index 155bb1fd3e..019b0dbebe 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java @@ -12,8 +12,6 @@ import static java.util.Objects.requireNonNull; import akka.actor.ActorSelection; import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Function; -import com.google.common.base.Supplier; import com.google.common.collect.Iterables; import com.google.common.util.concurrent.FluentFuture; import com.google.common.util.concurrent.Futures; @@ -119,22 +117,21 @@ public class TransactionProxy extends AbstractDOMStoreTransaction>>> futures = new ArrayList<>(allShardNames.size()); for (String shardName : allShardNames) { - futures.add(singleShardRead(shardName, YangInstanceIdentifier.EMPTY)); + futures.add(singleShardRead(shardName, YangInstanceIdentifier.empty())); } final ListenableFuture>>> listFuture = Futures.allAsList(futures); final ListenableFuture>> aggregateFuture; - aggregateFuture = Futures.transform(listFuture, - (Function>>, Optional>>) input -> { - try { - return NormalizedNodeAggregator.aggregate(YangInstanceIdentifier.EMPTY, input, - txContextFactory.getActorUtils().getSchemaContext(), - txContextFactory.getActorUtils().getDatastoreContext().getLogicalStoreType()); - } catch (DataValidationFailedException e) { - throw new IllegalArgumentException("Failed to aggregate", e); - } - }, MoreExecutors.directExecutor()); + aggregateFuture = Futures.transform(listFuture, input -> { + try { + return NormalizedNodeAggregator.aggregate(YangInstanceIdentifier.empty(), input, + txContextFactory.getActorUtils().getSchemaContext(), + txContextFactory.getActorUtils().getDatastoreContext().getLogicalStoreType()); + } catch (DataValidationFailedException e) { + throw new IllegalArgumentException("Failed to aggregate", e); + } + }, MoreExecutors.directExecutor()); return FluentFuture.from(aggregateFuture); } @@ -285,10 +282,8 @@ public class TransactionProxy extends AbstractDOMStoreTransaction txVersionSupplier = () -> wrapper.getTransactionContext().getTransactionVersion(); - cohorts.add(new ThreePhaseCommitCohortProxy.CohortInfo(wrapper.readyTransaction(shardNames), - txVersionSupplier)); + () -> wrapper.getTransactionContext().getTransactionVersion())); } return new ThreePhaseCommitCohortProxy(txContextFactory.getActorUtils(), cohorts, getIdentifier());