-
Notifications
You must be signed in to change notification settings - Fork 106
feat: Add methods to wait for consistency with a token #2762
Changes from 2 commits
85736e5
6fb1fab
b8e3916
0c1afd2
7915472
c989be1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1460,6 +1460,47 @@ public ApiFuture<Void> awaitReplicationAsync(final String tableId) { | |
| return stub.awaitReplicationCallable().futureCall(tableName); | ||
| } | ||
|
|
||
| /** | ||
| * 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); | ||
| } | ||
|
|
||
| /** | ||
| * Polls an existing consistency token until replication is consistent. Useful for checking | ||
|
jinseopkim0 marked this conversation as resolved.
Outdated
|
||
| * 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method is not replicating
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh gotcha. I think would make more sense to a bigtable customer (table replication across the cluster). |
||
| * @param consistencyToken The token to poll. | ||
| */ | ||
| public void waitForConsistency(String tableId, String consistencyToken) { | ||
| ApiExceptions.callAndTranslateApiException(waitForConsistencyAsync(tableId, consistencyToken)); | ||
| } | ||
|
|
||
| /** | ||
| * Asynchronously polls an existing consistency token. | ||
|
jinseopkim0 marked this conversation as resolved.
Outdated
|
||
| * | ||
| * @param tableId The table to check. | ||
| * @param consistencyToken The token to poll. | ||
| */ | ||
| public ApiFuture<Void> waitForConsistencyAsync(String tableId, String consistencyToken) { | ||
| return stub.awaitConsistencyCallable() | ||
| .futureCall(ConsistencyRequest.forReplication(tableId, consistencyToken)); | ||
| } | ||
|
|
||
| /** | ||
| * Creates a new authorized view with the specified configuration. | ||
| * | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.