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=5b447943ea7fd798e5572e55483ff8b4fcf7e331;hp=56220656ad2f53f578e4cccfde405578ab187e5e;hb=886fe1a50077d9dc9c4c36f938fc7c86317cb149;hpb=dcbf09a50b0f7fb437386f0433bd4464db1193de 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 56220656ad..5b447943ea 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 @@ -59,28 +59,33 @@ public class ThreePhaseCommitCohortProxy implements } @Override public ListenableFuture canCommit() { + LOG.debug("txn {} canCommit", transactionId); Callable call = new Callable() { @Override public Boolean call() throws Exception { for(ActorPath actorPath : cohortPaths){ + + Object message = new CanCommitTransaction().toSerializable(); + LOG.debug("txn {} Sending {} to {}", transactionId, message, actorPath); + ActorSelection cohort = actorContext.actorSelection(actorPath); try { Object response = actorContext.executeRemoteOperation(cohort, - new CanCommitTransaction().toSerializable(), + message, ActorContext.ASK_DURATION); if (response.getClass().equals(CanCommitTransactionReply.SERIALIZABLE_CLASS)) { CanCommitTransactionReply reply = CanCommitTransactionReply.fromSerializable(response); if (!reply.getCanCommit()) { - System.out.println("**TOM - failed: false"); return false; } } } catch(RuntimeException e){ + // FIXME : Need to properly handle this LOG.error("Unexpected Exception", e); return false; } @@ -94,14 +99,17 @@ public class ThreePhaseCommitCohortProxy implements } @Override public ListenableFuture preCommit() { + LOG.debug("txn {} preCommit", transactionId); return voidOperation(new PreCommitTransaction().toSerializable(), PreCommitTransactionReply.SERIALIZABLE_CLASS); } @Override public ListenableFuture abort() { + LOG.debug("txn {} abort", transactionId); return voidOperation(new AbortTransaction().toSerializable(), AbortTransactionReply.SERIALIZABLE_CLASS); } @Override public ListenableFuture commit() { + LOG.debug("txn {} commit", transactionId); return voidOperation(new CommitTransaction().toSerializable(), CommitTransactionReply.SERIALIZABLE_CLASS); } @@ -112,6 +120,8 @@ public class ThreePhaseCommitCohortProxy implements for(ActorPath actorPath : cohortPaths){ ActorSelection cohort = actorContext.actorSelection(actorPath); + LOG.debug("txn {} Sending {} to {}", transactionId, message, actorPath); + try { Object response = actorContext.executeRemoteOperation(cohort,