Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add PartitionedUpdate support to executor #2228

Merged

Conversation

rajatbhatta
Copy link
Contributor

This PR adds support for PartitionedUpdate to Cloud Client Executor Framework.

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: spanner Issues related to the googleapis/java-spanner API. labels Jan 12, 2023
@rajatbhatta
Copy link
Contributor Author

rajatbhatta commented Jan 12, 2023

The tests are expected to fail until proto changes for PartitionedUpdateAction is made public.

@rajatbhatta
Copy link
Contributor Author

@gyang-google: Can you please review this PR once?

@gyang-google
Copy link
Contributor

LGTM

@rajatbhatta rajatbhatta added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 25, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 25, 2023
@rajatbhatta rajatbhatta marked this pull request as ready for review February 25, 2023 13:11
@rajatbhatta rajatbhatta requested a review from a team as a code owner February 25, 2023 13:11
@rajatbhatta rajatbhatta added the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 1, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 1, 2023
@rajatbhatta rajatbhatta requested a review from arpan14 March 1, 2023 05:21
dbClient.executePartitionedUpdate(
Statement.of(action.getUpdate().getSql()),
Options.tag(options.getTag()),
Options.priority(RpcPriority.fromProto(options.getRpcPriority())));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Query - What's the behaviour when null is passed into this method?

Copy link
Contributor Author

@rajatbhatta rajatbhatta Mar 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RpcPriority.fromProto(null) will return RpcPriority.UNSPECIFIED. Added a unit test for this too.

for (RpcPriority e : RpcPriority.values()) {
if (e.proto.equals(proto)) return e;
}
return null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's preferred to not return nulls and instead return some modelled type like UNRECOGNIZED/UNKNOWN/UNSPECIFIED. With nulls, the client does not have a good way to know underlying reason i.e invalid enum type being the actual issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a RpcPriority.UNSPECIFIED to enum to map to Priority.PRIORITY_UNSPECIFIED. If a null value is passed in, we would return RpcPriority.UNSPECIFIED.

@rajatbhatta rajatbhatta added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 15, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 15, 2023
@rajatbhatta rajatbhatta added kokoro:force-run Add this label to force Kokoro to re-run the tests. automerge Merge the pull request once unit tests and other checks pass. owlbot:run Add this label to trigger the Owlbot post processor. labels Mar 15, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 15, 2023
@gcf-owl-bot gcf-owl-bot bot requested a review from a team as a code owner March 15, 2023 04:23
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 15, 2023
@gcf-merge-on-green gcf-merge-on-green bot merged commit 2c8ecf6 into googleapis:main Mar 15, 2023
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Mar 15, 2023
gcf-merge-on-green bot pushed a commit that referenced this pull request Mar 20, 2023
🤖 I have created a release *beep* *boop*
---


## [6.38.0](https://togithub.com/googleapis/java-spanner/compare/v6.37.0...v6.38.0) (2023-03-20)


### Features

* Add option to wait on session pool creation ([#2329](https://togithub.com/googleapis/java-spanner/issues/2329)) ([ff17244](https://togithub.com/googleapis/java-spanner/commit/ff17244ee918fa17c96488a0f7081728cda7b342))
* Add PartitionedUpdate support to executor ([#2228](https://togithub.com/googleapis/java-spanner/issues/2228)) ([2c8ecf6](https://togithub.com/googleapis/java-spanner/commit/2c8ecf6fee591df95ee4abfa230c3fcf0c34c589))


### Bug Fixes

* Correcting the proto field Id for field data_boost_enabled ([#2328](https://togithub.com/googleapis/java-spanner/issues/2328)) ([6159d7e](https://togithub.com/googleapis/java-spanner/commit/6159d7ec49b17f6bc40e1b8c93d1e64198c59dcf))
* Update executeCloudBatchDmlUpdates. ([#2326](https://togithub.com/googleapis/java-spanner/issues/2326)) ([27ef53c](https://togithub.com/googleapis/java-spanner/commit/27ef53c8447bd51a56fdfe6b2b206afe234fad80))


### Dependencies

* Update dependency com.google.cloud:google-cloud-monitoring to v3.14.0 ([#2333](https://togithub.com/googleapis/java-spanner/issues/2333)) ([9c81109](https://togithub.com/googleapis/java-spanner/commit/9c81109e452d6bae2598cf6cf541a09423a8ed6e))
* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.5.0 ([#2335](https://togithub.com/googleapis/java-spanner/issues/2335)) ([5eac2be](https://togithub.com/googleapis/java-spanner/commit/5eac2beb2ce5eebb61e70428e2ac2e11593fc986))
* Update dependency com.google.cloud:google-cloud-trace to v2.13.0 ([#2334](https://togithub.com/googleapis/java-spanner/issues/2334)) ([c461ba0](https://togithub.com/googleapis/java-spanner/commit/c461ba0b1a145cc3e9bee805ec6ad827376e5168))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
arpan14 pushed a commit to arpan14/java-spanner that referenced this pull request Mar 20, 2023
This PR adds support for PartitionedUpdate to Cloud Client Executor Framework.
arpan14 pushed a commit to arpan14/java-spanner that referenced this pull request Apr 28, 2023
🤖 I have created a release *beep* *boop*
---


## [6.38.0](https://togithub.com/googleapis/java-spanner/compare/v6.37.0...v6.38.0) (2023-03-20)


### Features

* Add option to wait on session pool creation ([googleapis#2329](https://togithub.com/googleapis/java-spanner/issues/2329)) ([ff17244](https://togithub.com/googleapis/java-spanner/commit/ff17244ee918fa17c96488a0f7081728cda7b342))
* Add PartitionedUpdate support to executor ([googleapis#2228](https://togithub.com/googleapis/java-spanner/issues/2228)) ([2c8ecf6](https://togithub.com/googleapis/java-spanner/commit/2c8ecf6fee591df95ee4abfa230c3fcf0c34c589))


### Bug Fixes

* Correcting the proto field Id for field data_boost_enabled ([googleapis#2328](https://togithub.com/googleapis/java-spanner/issues/2328)) ([6159d7e](https://togithub.com/googleapis/java-spanner/commit/6159d7ec49b17f6bc40e1b8c93d1e64198c59dcf))
* Update executeCloudBatchDmlUpdates. ([googleapis#2326](https://togithub.com/googleapis/java-spanner/issues/2326)) ([27ef53c](https://togithub.com/googleapis/java-spanner/commit/27ef53c8447bd51a56fdfe6b2b206afe234fad80))


### Dependencies

* Update dependency com.google.cloud:google-cloud-monitoring to v3.14.0 ([googleapis#2333](https://togithub.com/googleapis/java-spanner/issues/2333)) ([9c81109](https://togithub.com/googleapis/java-spanner/commit/9c81109e452d6bae2598cf6cf541a09423a8ed6e))
* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.5.0 ([googleapis#2335](https://togithub.com/googleapis/java-spanner/issues/2335)) ([5eac2be](https://togithub.com/googleapis/java-spanner/commit/5eac2beb2ce5eebb61e70428e2ac2e11593fc986))
* Update dependency com.google.cloud:google-cloud-trace to v2.13.0 ([googleapis#2334](https://togithub.com/googleapis/java-spanner/issues/2334)) ([c461ba0](https://togithub.com/googleapis/java-spanner/commit/c461ba0b1a145cc3e9bee805ec6ad827376e5168))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants