feat: Add methods to wait for consistency with a token#2762
Open
jinseopkim0 wants to merge 2 commits intomainfrom
Open
feat: Add methods to wait for consistency with a token#2762jinseopkim0 wants to merge 2 commits intomainfrom
jinseopkim0 wants to merge 2 commits intomainfrom
Conversation
This change adds support for checking consistency using a provided token, enabling distributed workflows. It also adds convenience methods to BigtableTableAdminClient for generating and waiting for a token automatically. This addresses the Consistency Tokens CUJ. Tracking Bug: b/475820272
lqiu96
reviewed
Feb 4, 2026
Comment on lines
+1463
to
+1480
| /** | ||
| * Generates a consistency token and polls it until replication is consistent. Blocks until | ||
| * completion. | ||
| * | ||
| * @param tableId The table to check. | ||
| */ | ||
| public void waitForConsistency(String tableId) { | ||
| awaitReplication(tableId); | ||
| } | ||
|
|
||
| /** | ||
| * Asynchronously generates a token and polls until consistent. | ||
| * | ||
| * @param tableId The table to check. | ||
| */ | ||
| public ApiFuture<Void> waitForConsistencyAsync(String tableId) { | ||
| return awaitReplicationAsync(tableId); | ||
| } |
Member
There was a problem hiding this comment.
qq, can you remind me why we need these public methods? If these are just wrappers around awaitReplication(async), what is the purpose? Is this just because the name conveys better intent?
lqiu96
reviewed
Feb 4, 2026
| * Polls an existing consistency token until replication is consistent. Useful for checking | ||
| * consistency of a token generated in a separate process. Blocks until completion. | ||
| * | ||
| * @param tableId The table to check. |
Member
There was a problem hiding this comment.
qq, I'm assuming this means the downstream table? e.g. If A wants to replicate data to B, then tableId refers to B?
If so, does that mean that replication is limited to one table or that a user would need to call this method multiple times?
lqiu96
reviewed
Feb 4, 2026
| * @param tableId The table ID. | ||
| * @param consistencyToken The token to check. | ||
| */ | ||
| public static ConsistencyRequest forReplication(String tableId, String consistencyToken) { |
Member
There was a problem hiding this comment.
qq, do we ensure that this is non-null? From below, if it is inputted as null here, then this would end up generating a new token. Would that have any impact?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change adds support for checking consistency using a provided token, enabling distributed workflows. It also adds convenience methods to BigtableTableAdminClient for generating and waiting for a token automatically.
This addresses the Consistency Tokens CUJ.
Tracking Bug: b/475820272