Skip to content

Commit c5650ae

Browse files
Google APIscopybara-github
authored andcommitted
feat: add new_partitions field for CloseStream for Cloud Bigtable ChangeStream
PiperOrigin-RevId: 512957844
1 parent 178674c commit c5650ae

1 file changed

Lines changed: 26 additions & 6 deletions

File tree

google/bigtable/v2/bigtable.proto

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -788,17 +788,37 @@ message ReadChangeStreamResponse {
788788
}
789789

790790
// A message indicating that the client should stop reading from the stream.
791-
// If status is OK and `continuation_tokens` is empty, the stream has finished
792-
// (for example if there was an `end_time` specified).
793-
// If `continuation_tokens` is present, then a change in partitioning requires
794-
// the client to open a new stream for each token to resume reading.
791+
// If status is OK and `continuation_tokens` & `new_partitions` are empty, the
792+
// stream has finished (for example if there was an `end_time` specified).
793+
// If `continuation_tokens` & `new_partitions` are present, then a change in
794+
// partitioning requires the client to open a new stream for each token to
795+
// resume reading. Example:
796+
// [B, D) ends
797+
// |
798+
// v
799+
// new_partitions: [A, C) [C, E)
800+
// continuation_tokens.partitions: [B,C) [C,D)
801+
// ^---^ ^---^
802+
// ^ ^
803+
// | |
804+
// | StreamContinuationToken 2
805+
// |
806+
// StreamContinuationToken 1
807+
// To read the new partition [A,C), supply the continuation tokens whose
808+
// ranges cover the new partition, for example ContinuationToken[A,B) &
809+
// ContinuationToken[B,C).
795810
message CloseStream {
796811
// The status of the stream.
797812
google.rpc.Status status = 1;
798813

799-
// If non-empty, contains the information needed to start reading the new
800-
// partition(s) that contain segments of this partition's row range.
814+
// If non-empty, contains the information needed to resume reading their
815+
// associated partitions.
801816
repeated StreamContinuationToken continuation_tokens = 2;
817+
818+
// If non-empty, contains the new partitions to start reading from, which
819+
// are related to but not necessarily identical to the partitions for the
820+
// above `continuation_tokens`.
821+
repeated StreamPartition new_partitions = 3;
802822
}
803823

804824
// The data or control message on the stream.

0 commit comments

Comments
 (0)