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=ec198510d3586f88dee40d04f9294a3fb370a9ae;hb=f9f6d8ed4b12e39386801f6b16b9485f5558336e;hp=19d9a66a528eb417d5bff41948641b68e9c8e481;hpb=9fe3fcabfe237c216028a44f508855ff0ff495a2;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 19d9a66a52..ec198510d3 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 @@ -8,7 +8,6 @@ package org.opendaylight.controller.cluster.datastore; -import akka.actor.ActorPath; import akka.actor.ActorSelection; import akka.dispatch.OnComplete; @@ -315,7 +314,7 @@ public class TransactionProxy implements DOMStoreReadWriteTransaction { LOG.debug("Tx {} Trying to get {} transactions ready for commit", identifier, remoteTransactionPaths.size()); } - List> cohortPathFutures = Lists.newArrayList(); + List> cohortFutures = Lists.newArrayList(); for(TransactionContext transactionContext : remoteTransactionPaths.values()) { @@ -323,14 +322,14 @@ public class TransactionProxy implements DOMStoreReadWriteTransaction { LOG.debug("Tx {} Readying transaction for shard {}", identifier, transactionContext.getShardName()); } - cohortPathFutures.add(transactionContext.readyTransaction()); + cohortFutures.add(transactionContext.readyTransaction()); } if(transactionChainProxy != null){ - transactionChainProxy.onTransactionReady(cohortPathFutures); + transactionChainProxy.onTransactionReady(cohortFutures); } - return new ThreePhaseCommitCohortProxy(actorContext, cohortPathFutures, + return new ThreePhaseCommitCohortProxy(actorContext, cohortFutures, identifier.toString()); } @@ -439,7 +438,7 @@ public class TransactionProxy implements DOMStoreReadWriteTransaction { void closeTransaction(); - Future readyTransaction(); + Future readyTransaction(); void writeData(YangInstanceIdentifier path, NormalizedNode data); @@ -499,10 +498,6 @@ public class TransactionProxy implements DOMStoreReadWriteTransaction { return actor; } - private String getResolvedCohortPath(String cohortPath) { - return actorContext.resolvePath(actorPath, cohortPath); - } - @Override public void closeTransaction() { if(LOG.isDebugEnabled()) { @@ -512,7 +507,7 @@ public class TransactionProxy implements DOMStoreReadWriteTransaction { } @Override - public Future readyTransaction() { + public Future readyTransaction() { if(LOG.isDebugEnabled()) { LOG.debug("Tx {} readyTransaction called with {} previous recorded operations pending", identifier, recordedOperationFutures.size()); @@ -538,9 +533,9 @@ public class TransactionProxy implements DOMStoreReadWriteTransaction { // Transform the combined Future into a Future that returns the cohort actor path from // the ReadyTransactionReply. That's the end result of the ready operation. - return combinedFutures.transform(new AbstractFunction1, ActorPath>() { + return combinedFutures.transform(new AbstractFunction1, ActorSelection>() { @Override - public ActorPath apply(Iterable notUsed) { + public ActorSelection apply(Iterable notUsed) { if(LOG.isDebugEnabled()) { LOG.debug("Tx {} readyTransaction: pending recorded operations succeeded", identifier); @@ -557,16 +552,9 @@ public class TransactionProxy implements DOMStoreReadWriteTransaction { if(serializedReadyReply.getClass().equals( ReadyTransactionReply.SERIALIZABLE_CLASS)) { ReadyTransactionReply reply = ReadyTransactionReply.fromSerializable( - actorContext.getActorSystem(), serializedReadyReply); - - String resolvedCohortPath = getResolvedCohortPath( - reply.getCohortPath().toString()); + serializedReadyReply); - if(LOG.isDebugEnabled()) { - LOG.debug("Tx {} readyTransaction: resolved cohort path {}", - identifier, resolvedCohortPath); - } - return actorContext.actorFor(resolvedCohortPath); + return actorContext.actorSelection(reply.getCohortPath()); } else { // Throwing an exception here will fail the Future. @@ -805,7 +793,7 @@ public class TransactionProxy implements DOMStoreReadWriteTransaction { } @Override - public Future readyTransaction() { + public Future readyTransaction() { if(LOG.isDebugEnabled()) { LOG.debug("Tx {} readyTransaction called", identifier); }