samples: add samples for tagging feature - #1478
Conversation
|
Here is the summary of changes. You are about to add 2 region tags.
This comment is generated by snippet-bot.
|
| databaseClient | ||
| .readWriteTransaction(Options.tag("app=concert,env=dev")) | ||
| .run( | ||
| new TransactionCallable<Void>() { |
There was a problem hiding this comment.
nit: could you use Java 8 lambda notation instead of an anonymous class?
.run(transaction -> {
...
})
| // Execute query multiple times to give a better chance of being part of the TopN tables. | ||
| for (int i = 0; i < 50; i++) { | ||
| final String out = runSample(() -> TransactionWithTagSample.setRequestTag(client)); | ||
| assertThat(out).contains("1 1 title 1"); |
There was a problem hiding this comment.
How long does this take to run? Could we break as soon as we reach a condition?
| if (queryStatsFound) { | ||
| break; | ||
| } | ||
| Thread.sleep(5000); |
There was a problem hiding this comment.
Could we reduce the sleep time here?
larkee
left a comment
There was a problem hiding this comment.
The set_transaction_tag sample is based on an outdated version of the spec. Please update it to match the current spec.
|
Closing in favour of #1496 |
Supersedes #1042
Adds a sample for assigning and querying tags.
Follow-up to #576
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> ☕️