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%2FTransactionProxy.java;h=00196ebd078e37f9778f94af9e8ab3a47dd9bb53;hp=32bb7d0951964975b850c8a1a685ce7d95c03f47;hb=dae79bb685addd04c5745bd056b147a47ec9773f;hpb=f78020d87663c8d9db1e4e33939f7b8b703703f8 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 32bb7d0951..00196ebd07 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 @@ -59,17 +59,17 @@ public class TransactionProxy implements DOMStoreReadWriteTransaction { private static final AtomicLong counter = new AtomicLong(); - private final TransactionType readOnly; + private final TransactionType transactionType; private final ActorContext actorContext; private final Map remoteTransactionPaths = new HashMap<>(); private final String identifier; public TransactionProxy( ActorContext actorContext, - TransactionType readOnly) { + TransactionType transactionType) { this.identifier = "transaction-" + counter.getAndIncrement(); - this.readOnly = readOnly; + this.transactionType = transactionType; this.actorContext = actorContext; Object response = actorContext.executeShardOperation(Shard.DEFAULT_NAME, new CreateTransaction(), ActorContext.ASK_DURATION); @@ -91,6 +91,9 @@ public class TransactionProxy implements DOMStoreReadWriteTransaction { ActorContext.ASK_DURATION); if(response instanceof ReadDataReply){ ReadDataReply reply = (ReadDataReply) response; + if(reply.getNormalizedNode() == null){ + return Optional.absent(); + } //FIXME : A cast should not be required here ??? return (Optional>) Optional.of(reply.getNormalizedNode()); } @@ -142,7 +145,7 @@ public class TransactionProxy implements DOMStoreReadWriteTransaction { } } - return new ThreePhaseCommitCohortProxy(cohortPaths); + return new ThreePhaseCommitCohortProxy(actorContext, cohortPaths); } @Override