-
Notifications
You must be signed in to change notification settings - Fork 131
samples: add support for BatchWriteAtLeastOnce #2506
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
Conversation
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
samples/snippets/src/main/java/com/example/spanner/BatchWriteAtLeastOnceSample.java
Outdated
Show resolved
Hide resolved
samples/snippets/src/main/java/com/example/spanner/BatchWriteAtLeastOnceSample.java
Outdated
Show resolved
Hide resolved
samples/snippets/src/main/java/com/example/spanner/BatchWriteAtLeastOnceSample.java
Outdated
Show resolved
Hide resolved
* Assume DDL for the underlying database: | ||
* <pre>{@code | ||
* CREATE TABLE Singers ( | ||
* SingerId INT64 NOT NULL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add a couple of spaces for indentation
projectId, instanceId, databaseId)); | ||
assertTrue( | ||
out.contains("have been applied with commit timestamp") | ||
|| out.contains("could not be applied with error code")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't expect an error here, do we? So in that case I think we should let the test case fail with the error instead of letting the test pass here.
If it is possible that the call fails with a transient error (e.g. UNAVAILABLE or ABORTED), then I think that the sample should show how customers should handle that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree we should exclude out.contains("could not be applied with error code")
and let the test case fail. Modified this.
* samples: add support for BatchWriteAtleastOnce * samples: add support for BatchWriteAtleastOnce * samples: add support for BatchWriteAtleastOnce * modify sample based on new design * remove host * chore: review comments. * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: fix review comments. --------- Co-authored-by: Arpan Mishra <[email protected]> Co-authored-by: Arpan Mishra <[email protected]> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Note: Github checks are expected to fail until #2520 is released, and a new
libraries-bom
version is out.