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: add support for tagging #576
Conversation
This comment has been minimized.
This comment has been minimized.
google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractReadContext.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractReadContext.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClientImpl.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClientImpl.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionRunnerImpl.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionRunnerImpl.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/OptionsTest.java
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
+@syeduguri Please review |
This comment has been minimized.
This comment has been minimized.
google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionContext.java
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
Codecov Report
@@ Coverage Diff @@
## master #576 +/- ##
============================================
+ Coverage 85.18% 85.27% +0.08%
- Complexity 2640 2660 +20
============================================
Files 155 155
Lines 14413 14449 +36
Branches 1348 1362 +14
============================================
+ Hits 12278 12321 +43
+ Misses 1567 1561 -6
+ Partials 568 567 -1 Continue to review full report at Codecov.
|
@olavloite @thiagotnunes I re-rebased PR based on #716, I'd like to get your reviews and approval. |
I think the transaction tag feature could be simplified somewhat. See my suggestions below.
google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractReadContext.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractReadContext.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractReadContext.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractReadContext.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractReadContext.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionRunnerImpl.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionRunnerImpl.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/Options.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionRunnerImpl.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/AbstractReadContextTest.java
Show resolved
Hide resolved
@olavloite thanks for the suggestions. I made the necessary changes, PTAL.
google-cloud-spanner/src/test/java/com/google/cloud/spanner/AbstractReadContextTest.java
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractReadContext.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractReadContext.java
Outdated
Show resolved
Hide resolved
@thiagotnunes @elharo @skuruppu this is ready to review. PTAL |
* {@link AbstractReadContext} does not have a transaction tag. | ||
*/ | ||
@Nullable | ||
String getTransactionTag() { |
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: could we also create a hasTransactionTag()
that checks if getTransactionTag() != null
?
google-cloud-spanner/src/test/java/com/google/cloud/spanner/OptionsTest.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/OptionsTest.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/OptionsTest.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/OptionsTest.java
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/OptionsTest.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/OptionsTest.java
Show resolved
Hide resolved
The samples build failure is unrelated to this change |
Description
Add support to enable users to set
tags
on database operations such as reads, queries and transactions.Background
The statistics of queries, reads and transactions in Cloud Spanner are stored. Providing tags for database operations will allow these statistics to be grouped by a tag and makes queries/transactions easily searchable by tag. This will help make the information provided by the statistics more useful.
TODO
RequestOptions
proto changes are published.Note: samples will be handled in a separate PR.