-
Notifications
You must be signed in to change notification settings - Fork 85
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
docs(samples): Check for error from BatchCommitWriteStreams #940
docs(samples): Check for error from BatchCommitWriteStreams #940
Conversation
@@ -90,6 +90,10 @@ public static void writePendingStream(String projectId, String datasetName, Stri | |||
.build(); | |||
BatchCommitWriteStreamsResponse commitResponse = | |||
client.batchCommitWriteStreams(commitRequest); | |||
// If the response does not have a commit time, it means the commit operation failed. | |||
if (commitResponse.hasCommitTime() == false) { |
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.
Does it not return an error object in this case? User is expected to guess that something went wrong?
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.
The user can call getStreamErrorsList to get a list of StorageError's. You could use this to look at the error per stream. Does it make sense to show this?
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.
I think it would make more sense to just show the error objects rather than show hasCommitTime indirectly.
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.
Per @yirutang checking for hasCommitTime is more semantically meaningful, because that's the error condition. I added code to display the list of error messages.
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.
Got it. SGTM.
Codecov Report
@@ Coverage Diff @@
## master #940 +/- ##
============================================
+ Coverage 80.92% 81.05% +0.13%
- Complexity 1020 1038 +18
============================================
Files 76 77 +1
Lines 5556 5632 +76
Branches 427 431 +4
============================================
+ Hits 4496 4565 +69
Misses 884 884
- Partials 176 183 +7
Continue to review full report at Codecov.
|
Merge-on-green attempted to merge your PR for 6 hours, but it was not mergeable because either one of your required status checks failed, one of your required reviews was not approved, or there is a do not merge label. Learn more about your required status checks here: https://help.github.com/en/github/administering-a-repository/enabling-required-status-checks. You can remove and reapply the label to re-run the bot. |
🤖 I have created a release \*beep\* \*boop\* --- ## [1.16.0](https://www.github.com/googleapis/java-bigquerystorage/compare/v1.15.1...v1.16.0) (2021-03-25) ### Features * Add CivilTimeEncoder to encode and decode DateTime/Time as numerics ([#937](https://www.github.com/googleapis/java-bigquerystorage/issues/937)) ([969b429](https://www.github.com/googleapis/java-bigquerystorage/commit/969b4290b9934b94b1a0113e04e37ff44b2a536e)) ### Bug Fixes * add a deprecation message on StreamWriter ([#922](https://www.github.com/googleapis/java-bigquerystorage/issues/922)) ([fce5289](https://www.github.com/googleapis/java-bigquerystorage/commit/fce52890c6948a9b78a62d2fe0e4f9768d10d401)) ### Dependencies * update dependency com.google.cloud:google-cloud-bigquery to v1.127.10 ([#955](https://www.github.com/googleapis/java-bigquerystorage/issues/955)) ([c810c72](https://www.github.com/googleapis/java-bigquerystorage/commit/c810c7279bfbad31cb0f94f5ad5d4a74342d4481)) * update dependency com.google.cloud:google-cloud-bigquery to v1.127.9 ([#947](https://www.github.com/googleapis/java-bigquerystorage/issues/947)) ([d781dc5](https://www.github.com/googleapis/java-bigquerystorage/commit/d781dc5479602fee01eb971033978317e5669694)) ### Documentation * **samples:** Check for error from BatchCommitWriteStreams ([#940](https://www.github.com/googleapis/java-bigquerystorage/issues/940)) ([ab3c145](https://www.github.com/googleapis/java-bigquerystorage/commit/ab3c1453d3c1fb627e773d0e7ca4ec991f8d38b7)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## [0.124.7](googleapis/java-storage-nio@v0.124.6...v0.124.7) (2022-06-29) ### Dependencies * update dependency com.google.cloud:google-cloud-storage to v2.9.0 ([googleapis#939](googleapis/java-storage-nio#939)) ([ae5d294](googleapis/java-storage-nio@ae5d294)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
If the returned BatchCommitWriteStreamsResponse does not have a commit time, it means an error occurred.