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%2FSingleCommitCohortProxy.java;h=9c17bc1a476c3c95060498656df9061a8312bcab;hp=e340859321c6ae7231fcc52b7b4e6ab80a9efd30;hb=8e6e0aeb5ca474cb292aab6ca581e921b0a56489;hpb=412db94945c5db5d2da918f5e23bd3abcecc4d10 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/SingleCommitCohortProxy.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/SingleCommitCohortProxy.java index e340859321..9c17bc1a47 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/SingleCommitCohortProxy.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/SingleCommitCohortProxy.java @@ -7,10 +7,7 @@ */ package org.opendaylight.controller.cluster.datastore; -import akka.actor.ActorSelection; -import akka.dispatch.Futures; import akka.dispatch.OnComplete; -import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; import java.util.Arrays; @@ -24,8 +21,7 @@ import scala.concurrent.Future; /** * A cohort proxy implementation for a single-shard transaction commit. If the transaction was a direct commit * to the shard, this implementation elides the CanCommitTransaction and CommitTransaction messages to the - * shard as an optimization. Otherwise the 3-phase commit to the shard is delegated to a - * ThreePhaseCommitCohortProxy instance (this is for backwards compatibility with pre-Lithium versions). + * shard as an optimization. * * @author Thomas Pantelis */ @@ -63,11 +59,6 @@ class SingleCommitCohortProxy extends AbstractThreePhaseCommitCohort { operationCallbackRef.get().success(); - if(cohortResponse instanceof ActorSelection) { - handlePreLithiumActorCohort((ActorSelection)cohortResponse, returnFuture); - return; - } - LOG.debug("Tx {} successfully completed direct commit", transactionId); // The Future was the result of a direct commit to the shard, essentially eliding the @@ -101,22 +92,4 @@ class SingleCommitCohortProxy extends AbstractThreePhaseCommitCohort { List> getCohortFutures() { return Arrays.asList(cohortFuture); } - - private void handlePreLithiumActorCohort(ActorSelection actorSelection, final SettableFuture returnFuture) { - // Handle backwards compatibility. An ActorSelection response would be returned from a - // pre-Lithium version. In this case delegate to a ThreePhaseCommitCohortProxy. - delegateCohort = new ThreePhaseCommitCohortProxy(actorContext, - Arrays.asList(Futures.successful(actorSelection)), transactionId); - com.google.common.util.concurrent.Futures.addCallback(delegateCohort.canCommit(), new FutureCallback() { - @Override - public void onSuccess(Boolean canCommit) { - returnFuture.set(canCommit); - } - - @Override - public void onFailure(Throwable t) { - returnFuture.setException(t); - } - }); - } }