googleapis / java-spanner Public
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: adds options to the write operations #531
feat: adds options to the write operations #531
Conversation
Adds the possibility of adding options to the write operations and encapsulates the write response into it's own class so that we can augment the response with more fields than the commit timestamp.
67a2379
to
48da5a4
Compare
Codecov Report
@@ Coverage Diff @@
## master #531 +/- ##
============================================
- Coverage 84.03% 83.88% -0.15%
- Complexity 2537 2540 +3
============================================
Files 140 141 +1
Lines 13891 13918 +27
Branches 1329 1330 +1
============================================
+ Hits 11673 11675 +2
- Misses 1674 1699 +25
Partials 544 544
Continue to review full report at Codecov.
|
Updates WriteOption to TransactionOption and changes the WriteResponse to CommitResponse.
* | ||
* @return a response with the timestamp at which the write was committed | ||
*/ | ||
CommitResponse writeWithOptions(Iterable<Mutation> mutations, TransactionOption... options) |
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.
What do you think about WriteOption
in place of TransactionOption
?
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.
Thiago and I had a short discussion about this, and we think TransactionOption
is better in this case, as we intend to also use this for options that we will need for normal read/write transactions.
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.
Ok sgtm
Adds the possibility of adding options to the write operations and encapsulates the write response into its own class so that we can augment the response with more fields than the commit timestamp.
At the moment, the new methods just delegate to the existing write methods. Once we add write option implementations we should change the definition of the added methods.