support datastore transaction options#2613
Conversation
|
Removing myself as reviewer since this is WIP and @vam-google is secondary on Datastore. |
|
Kindly ping |
| } | ||
| } | ||
|
|
||
| void setPrevTransactionId(Transaction transaction) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| if (transaction.isActive()) { | ||
| transaction.rollback(); | ||
| } | ||
| if (options.getModeCase().equals(TransactionOptions.ModeCase.READ_WRITE)) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| } | ||
|
|
||
| @Override | ||
| public <T> T runInTransaction(final TransactionCallable<T> callable, TransactionOptions options) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| @Override | ||
| public ByteString getTransactionId() { | ||
| return transaction; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| options = | ||
| options | ||
| .toBuilder() | ||
| .setReadWrite( |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| } | ||
|
|
||
| void setPrevTransactionId(Transaction transaction) { | ||
| options = |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| * | ||
| * @param <T> the type of the return value | ||
| */ | ||
| interface ReadWriteTransactionCallable<T> { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
PTAL @vam-google |
vam-google
left a comment
There was a problem hiding this comment.
LGTM with few minor comments.
| assertEquals(entity2, values.get(1)); | ||
| verify(transaction); | ||
| } | ||
|
|
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
google-cloud-datastore/pom.xml
Outdated
| <groupId>com.google.cloud.datastore</groupId> | ||
| <artifactId>datastore-v1-proto-client</artifactId> | ||
| <version>1.4.1</version> | ||
| <version>1.5.1</version> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@neozwu would you be able to finish this up? |
|
@garrettjonesgoogle should be ready to merge once API goes public |
|
I added the "status: blocked" tag since this is blocked on the server side. |
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
In this PR: - In the integration test, run `generate_repo.py` and `generate_pr_description.py` in docker container. - Remove test image in cloud build. Context: In this [log](https://github.com/googleapis/google-cloud-java/actions/runs/8445620169/job/23133097820), the nightly generation job only took 3 mins. After investigation, we found out that removing `main` method in `generate_repo.py` (#2598) caused the CLI is not running despite that the job returns successfully. This non-explicit failure demonstrated that there's difference between calling CLI (`generate` method in `generate_repo.py`) and its implementation (`generate_from_yaml` method in `generate_repo.py`). We decided to change the integration test to run the CLI in docker container, rather than testing `generate_from_yaml` because it is the containerized CLI will be used in downstream libraries.
No description provided.