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.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.utils.ActorContext;
+import org.opendaylight.controller.cluster.datastore.utils.TransactionIdentifierUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import scala.concurrent.Future;
// 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();
}
}
+ /**
+ * @deprecated Temporary utility for extracting transaction chain ID from a {@link TransactionIdentifier}
+ */
+ @Deprecated
+ static String compatTransactionChainId(final TransactionIdentifier txId) {
+ final long historyId = txId.getHistoryId().getHistoryId();
+ return historyId == 0 ? "" : Long.toUnsignedString(historyId);
+ }
+
/**
* Performs a CreateTransaction try async.
*/
primaryShardInfo.getPrimaryShardActor());
}
- Object serializedCreateMessage = new CreateTransaction(getIdentifier().toString(),
- getTransactionType().ordinal(), getIdentifier().getChainId(),
+ Object serializedCreateMessage = new CreateTransaction(TransactionIdentifierUtils.actorNameFor(getIdentifier()),
+ getTransactionType().ordinal(), compatTransactionChainId(getIdentifier()),
primaryShardInfo.getPrimaryShardVersion()).toSerializable();
Future<Object> createTxFuture = getActorContext().executeOperationAsync(
transactionActor, getActorContext(), remoteTransactionVersion, transactionContextWrapper.getLimiter());
if(parent.getType() == TransactionType.READ_ONLY) {
- TransactionContextCleanup.track(this, ret);
+ TransactionContextCleanup.track(parent, ret);
}
return ret;