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%2FLocalThreePhaseCommitCohort.java;h=ec7b46d5bbd5ef278489560d534728999820ef65;hp=442e2f3b4dd77c88cfb3b57e868f5f5ed0a4d4fc;hb=b14856a01f6515e6063f82e5fb448f7e9a57029b;hpb=3f979acfb60c2ffb1ce70c5475bdfce8f8e7df01 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LocalThreePhaseCommitCohort.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LocalThreePhaseCommitCohort.java index 442e2f3b4d..ec7b46d5bb 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LocalThreePhaseCommitCohort.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LocalThreePhaseCommitCohort.java @@ -12,7 +12,6 @@ import akka.dispatch.Futures; import akka.dispatch.OnComplete; import com.google.common.base.Preconditions; import com.google.common.util.concurrent.ListenableFuture; -import javax.annotation.Nonnull; import org.opendaylight.controller.cluster.datastore.identifiers.TransactionIdentifier; import org.opendaylight.controller.cluster.datastore.messages.CommitTransactionReply; import org.opendaylight.controller.cluster.datastore.messages.ReadyLocalTransaction; @@ -38,7 +37,7 @@ class LocalThreePhaseCommitCohort implements DOMStoreThreePhaseCommitCohort { private final DataTreeModification modification; private final ActorContext actorContext; private final ActorSelection leader; - private Exception operationError; + private final Exception operationError; protected LocalThreePhaseCommitCohort(final ActorContext actorContext, final ActorSelection leader, final SnapshotBackedWriteTransaction transaction, final DataTreeModification modification) { @@ -46,6 +45,7 @@ class LocalThreePhaseCommitCohort implements DOMStoreThreePhaseCommitCohort { this.leader = Preconditions.checkNotNull(leader); this.transaction = Preconditions.checkNotNull(transaction); this.modification = Preconditions.checkNotNull(modification); + this.operationError = null; } protected LocalThreePhaseCommitCohort(final ActorContext actorContext, final ActorSelection leader, @@ -67,14 +67,6 @@ class LocalThreePhaseCommitCohort implements DOMStoreThreePhaseCommitCohort { return actorContext.executeOperationAsync(leader, message, actorContext.getTransactionCommitOperationTimeout()); } - void setOperationError(@Nonnull Exception operationError) { - if (this.operationError != null) { - LOG.info("Cohort {} already had operation error", this, this.operationError); - } - - this.operationError = Preconditions.checkNotNull(operationError); - } - Future initiateCoordinatedCommit() { final Future messageFuture = initiateCommit(false); final Future ret = TransactionReadyReplyMapper.transform(messageFuture, actorContext, @@ -103,7 +95,7 @@ class LocalThreePhaseCommitCohort implements DOMStoreThreePhaseCommitCohort { if (failure != null) { LOG.error("Failed to prepare transaction {} on backend", transaction.getIdentifier(), failure); transactionAborted(transaction); - } else if (CommitTransactionReply.SERIALIZABLE_CLASS.isInstance(message)) { + } else if (CommitTransactionReply.isSerializedType(message)) { LOG.debug("Transaction {} committed successfully", transaction.getIdentifier()); transactionCommitted(transaction); } else {