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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we reduce the sleep time here?
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 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> ☕️