X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FThreePhaseCommitCohortProxy.java;h=cd79ad6f19ed32fdb37a6b8204e1de0a47ee2ccd;hp=a96be9fcb1476098792ad2ed1a8f156a30f4e6c7;hb=e84f63ee098fff5b02cbce1281ca0d1208f966fa;hpb=3859df9beca8f13f1ff2b2744ed3470a1715bec3 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxy.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxy.java index a96be9fcb1..cd79ad6f19 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxy.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxy.java @@ -12,7 +12,6 @@ import static java.util.Objects.requireNonNull; import akka.actor.ActorSelection; import akka.dispatch.OnComplete; -import com.google.common.base.Supplier; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; @@ -22,6 +21,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Supplier; import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier; import org.opendaylight.controller.cluster.datastore.messages.AbortTransaction; import org.opendaylight.controller.cluster.datastore.messages.AbortTransactionReply; @@ -157,7 +157,7 @@ public class ThreePhaseCommitCohortProxy extends AbstractThreePhaseCommitCohort< final Iterator iterator = cohorts.iterator(); - final OnComplete onComplete = new OnComplete() { + final OnComplete onComplete = new OnComplete<>() { @Override public void onComplete(final Throwable failure, final Object response) { if (failure != null) { @@ -192,7 +192,7 @@ public class ThreePhaseCommitCohortProxy extends AbstractThreePhaseCommitCohort< sendCanCommitTransaction(iterator.next(), this); } else { LOG.debug("Tx {}: canCommit returning result: {}", transactionId, result); - returnFuture.set(Boolean.valueOf(result)); + returnFuture.set(result); } } @@ -365,9 +365,10 @@ public class ThreePhaseCommitCohortProxy extends AbstractThreePhaseCommitCohort< static class CohortInfo { private final Future actorFuture; - private volatile ActorSelection resolvedActor; private final Supplier actorVersionSupplier; + private volatile ActorSelection resolvedActor; + CohortInfo(final Future actorFuture, final Supplier actorVersionSupplier) { this.actorFuture = actorFuture; this.actorVersionSupplier = actorVersionSupplier;