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=357ab92c819946ccc9e008db0a6b9fd1ad5bcf2f;hp=8d85bdcb666a24755a567db6fffa7d18c1fb9feb;hb=edd61d79da614388134b0e0a618010c91e9c91bd;hpb=600e07c2adb213b614cad127070f1e7ff074b42b 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 8d85bdcb66..357ab92c81 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 @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; +import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier; import org.opendaylight.controller.cluster.datastore.messages.AbortTransaction; import org.opendaylight.controller.cluster.datastore.messages.AbortTransactionReply; import org.opendaylight.controller.cluster.datastore.messages.CanCommitTransaction; @@ -41,7 +42,7 @@ public class ThreePhaseCommitCohortProxy extends AbstractThreePhaseCommitCohort< private static final MessageSupplier COMMIT_MESSAGE_SUPPLIER = new MessageSupplier() { @Override - public Object newMessage(String transactionId, short version) { + public Object newMessage(TransactionIdentifier transactionId, short version) { return new CommitTransaction(transactionId, version).toSerializable(); } @@ -53,7 +54,7 @@ public class ThreePhaseCommitCohortProxy extends AbstractThreePhaseCommitCohort< private static final MessageSupplier ABORT_MESSAGE_SUPPLIER = new MessageSupplier() { @Override - public Object newMessage(String transactionId, short version) { + public Object newMessage(TransactionIdentifier transactionId, short version) { return new AbortTransaction(transactionId, version).toSerializable(); } @@ -66,13 +67,14 @@ public class ThreePhaseCommitCohortProxy extends AbstractThreePhaseCommitCohort< private final ActorContext actorContext; private final List cohorts; private final SettableFuture cohortsResolvedFuture = SettableFuture.create(); - private final String transactionId; + private final TransactionIdentifier transactionId; private volatile OperationCallback commitOperationCallback; - public ThreePhaseCommitCohortProxy(ActorContext actorContext, List cohorts, String transactionId) { + public ThreePhaseCommitCohortProxy(ActorContext actorContext, List cohorts, + TransactionIdentifier transactionId) { this.actorContext = actorContext; this.cohorts = cohorts; - this.transactionId = transactionId; + this.transactionId = Preconditions.checkNotNull(transactionId); if(cohorts.isEmpty()) { cohortsResolvedFuture.set(null); @@ -392,7 +394,7 @@ public class ThreePhaseCommitCohortProxy extends AbstractThreePhaseCommitCohort< } private interface MessageSupplier { - Object newMessage(String transactionId, short version); + Object newMessage(TransactionIdentifier transactionId, short version); boolean isSerializedReplyType(Object reply); } }