Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
BUG-5280: fix invalid local transaction replay
[controller.git]
/
opendaylight
/
md-sal
/
sal-distributed-datastore
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
cluster
/
datastore
/
SingleCommitCohortProxy.java
diff --git
a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/SingleCommitCohortProxy.java
b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/SingleCommitCohortProxy.java
index 0823c902ae4947ede13b3807a70a04cc46546704..033cbeaae7b43437cfd4b540207a4700d53fd266 100644
(file)
--- a/
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/SingleCommitCohortProxy.java
+++ b/
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/SingleCommitCohortProxy.java
@@
-8,10
+8,12
@@
package org.opendaylight.controller.cluster.datastore;
import akka.dispatch.OnComplete;
package org.opendaylight.controller.cluster.datastore;
import akka.dispatch.OnComplete;
+import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
import java.util.Arrays;
import java.util.List;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
import java.util.Arrays;
import java.util.List;
+import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
import org.slf4j.Logger;
import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
import org.slf4j.Logger;
@@
-21,8
+23,7
@@
import scala.concurrent.Future;
/**
* A cohort proxy implementation for a single-shard transaction commit. If the transaction was a direct commit
* to the shard, this implementation elides the CanCommitTransaction and CommitTransaction messages to the
/**
* A cohort proxy implementation for a single-shard transaction commit. If the transaction was a direct commit
* to the shard, this implementation elides the CanCommitTransaction and CommitTransaction messages to the
- * shard as an optimization. Otherwise the 3-phase commit to the shard is delegated to a
- * ThreePhaseCommitCohortProxy instance (this is for backwards compatibility with pre-Lithium versions).
+ * shard as an optimization.
*
* @author Thomas Pantelis
*/
*
* @author Thomas Pantelis
*/
@@
-31,15
+32,15
@@
class SingleCommitCohortProxy extends AbstractThreePhaseCommitCohort<Object> {
private final ActorContext actorContext;
private final Future<Object> cohortFuture;
private final ActorContext actorContext;
private final Future<Object> cohortFuture;
- private final
String
transactionId;
+ private final
TransactionIdentifier
transactionId;
private volatile DOMStoreThreePhaseCommitCohort delegateCohort = NoOpDOMStoreThreePhaseCommitCohort.INSTANCE;
private final OperationCallback.Reference operationCallbackRef;
private volatile DOMStoreThreePhaseCommitCohort delegateCohort = NoOpDOMStoreThreePhaseCommitCohort.INSTANCE;
private final OperationCallback.Reference operationCallbackRef;
- SingleCommitCohortProxy(ActorContext actorContext, Future<Object> cohortFuture,
String
transactionId,
+ SingleCommitCohortProxy(ActorContext actorContext, Future<Object> cohortFuture,
TransactionIdentifier
transactionId,
OperationCallback.Reference operationCallbackRef) {
this.actorContext = actorContext;
this.cohortFuture = cohortFuture;
OperationCallback.Reference operationCallbackRef) {
this.actorContext = actorContext;
this.cohortFuture = cohortFuture;
- this.transactionId =
transactionId
;
+ this.transactionId =
Preconditions.checkNotNull(transactionId)
;
this.operationCallbackRef = operationCallbackRef;
}
this.operationCallbackRef = operationCallbackRef;
}
@@
-52,7
+53,7
@@
class SingleCommitCohortProxy extends AbstractThreePhaseCommitCohort<Object> {
cohortFuture.onComplete(new OnComplete<Object>() {
@Override
public void onComplete(Throwable failure, Object cohortResponse) {
cohortFuture.onComplete(new OnComplete<Object>() {
@Override
public void onComplete(Throwable failure, Object cohortResponse) {
- if(failure != null) {
+ if
(failure != null) {
operationCallbackRef.get().failure();
returnFuture.setException(failure);
return;
operationCallbackRef.get().failure();
returnFuture.setException(failure);
return;