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: move DataTreeCandidate serialization to its own class
[controller.git]
/
opendaylight
/
md-sal
/
sal-distributed-datastore
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
cluster
/
datastore
/
RemoteTransactionContextSupport.java
diff --git
a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/RemoteTransactionContextSupport.java
b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/RemoteTransactionContextSupport.java
index 8f5aade018aa936eb9b3a42fcc4e9a4539961afb..2924eaab574f2e3bb95b30877d7bef2328a0d6cf 100644
(file)
--- a/
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/RemoteTransactionContextSupport.java
+++ b/
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/RemoteTransactionContextSupport.java
@@
-14,9
+14,9
@@
import akka.pattern.AskTimeoutException;
import akka.util.Timeout;
import com.google.common.base.Preconditions;
import java.util.concurrent.TimeUnit;
import akka.util.Timeout;
import com.google.common.base.Preconditions;
import java.util.concurrent.TimeUnit;
+import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
import org.opendaylight.controller.cluster.datastore.exceptions.NoShardLeaderException;
import org.opendaylight.controller.cluster.datastore.exceptions.ShardLeaderNotRespondingException;
import org.opendaylight.controller.cluster.datastore.exceptions.NoShardLeaderException;
import org.opendaylight.controller.cluster.datastore.exceptions.ShardLeaderNotRespondingException;
-import org.opendaylight.controller.cluster.datastore.identifiers.TransactionIdentifier;
import org.opendaylight.controller.cluster.datastore.messages.CreateTransaction;
import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionReply;
import org.opendaylight.controller.cluster.datastore.messages.PrimaryShardInfo;
import org.opendaylight.controller.cluster.datastore.messages.CreateTransaction;
import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionReply;
import org.opendaylight.controller.cluster.datastore.messages.PrimaryShardInfo;
@@
-110,14
+110,14
@@
final class RemoteTransactionContextSupport {
// For write-only Tx's we prepare the transaction modifications directly on the shard actor
// to avoid the overhead of creating a separate transaction actor.
transactionContextWrapper.executePriorTransactionOperations(createValidTransactionContext(
// For write-only Tx's we prepare the transaction modifications directly on the shard actor
// to avoid the overhead of creating a separate transaction actor.
transactionContextWrapper.executePriorTransactionOperations(createValidTransactionContext(
- primaryShard,
primaryShard.path().toString(
), primaryShardInfo.getPrimaryShardVersion()));
+ primaryShard,
String.valueOf(primaryShard.path()
), primaryShardInfo.getPrimaryShardVersion()));
} else {
tryCreateTransaction();
}
}
/**
} else {
tryCreateTransaction();
}
}
/**
-
*
Performs a CreateTransaction try async.
+ Performs a CreateTransaction try async.
*/
private void tryCreateTransaction() {
if(LOG.isDebugEnabled()) {
*/
private void tryCreateTransaction() {
if(LOG.isDebugEnabled()) {
@@
-125,8
+125,7
@@
final class RemoteTransactionContextSupport {
primaryShardInfo.getPrimaryShardActor());
}
primaryShardInfo.getPrimaryShardActor());
}
- Object serializedCreateMessage = new CreateTransaction(getIdentifier().toString(),
- getTransactionType().ordinal(), getIdentifier().getChainId(),
+ Object serializedCreateMessage = new CreateTransaction(getIdentifier(), getTransactionType().ordinal(),
primaryShardInfo.getPrimaryShardVersion()).toSerializable();
Future<Object> createTxFuture = getActorContext().executeOperationAsync(
primaryShardInfo.getPrimaryShardVersion()).toSerializable();
Future<Object> createTxFuture = getActorContext().executeOperationAsync(
@@
-249,15
+248,11
@@
final class RemoteTransactionContextSupport {
private TransactionContext createValidTransactionContext(ActorSelection transactionActor, String transactionPath,
short remoteTransactionVersion) {
private TransactionContext createValidTransactionContext(ActorSelection transactionActor, String transactionPath,
short remoteTransactionVersion) {
- // TxActor is always created where the leader of the shard is.
- // Check if TxActor is created in the same node
- boolean isTxActorLocal = getActorContext().isPathLocal(transactionPath);
final TransactionContext ret = new RemoteTransactionContext(transactionContextWrapper.getIdentifier(),
final TransactionContext ret = new RemoteTransactionContext(transactionContextWrapper.getIdentifier(),
- transactionActor, getActorContext(), isTxActorLocal, remoteTransactionVersion,
- transactionContextWrapper.getLimiter());
+ transactionActor, getActorContext(), remoteTransactionVersion, transactionContextWrapper.getLimiter());
if(parent.getType() == TransactionType.READ_ONLY) {
if(parent.getType() == TransactionType.READ_ONLY) {
- TransactionContextCleanup.track(
this
, ret);
+ TransactionContextCleanup.track(
parent
, ret);
}
return ret;
}
return ret;