Skip to content

Commit

Permalink
feat: add new_partitions field for CloseStream for Cloud Bigtable Cha…
Browse files Browse the repository at this point in the history
…ngeStream (#740)

* feat: add new_partitions field for CloseStream for Cloud Bigtable ChangeStream

PiperOrigin-RevId: 512957844

Source-Link: googleapis/googleapis@c5650ae

Source-Link: googleapis/googleapis-gen@a71ec9c
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTcxZWM5Y2MwYTg3MTI4NjU4N2YxZGYxYzVlNDM0YzViYzMzOGY5MSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Mar 1, 2023
1 parent fcc886d commit 1adcad4
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions google/cloud/bigtable_v2/types/bigtable.py
Expand Up @@ -1052,19 +1052,28 @@ class Heartbeat(proto.Message):

class CloseStream(proto.Message):
r"""A message indicating that the client should stop reading from the
stream. If status is OK and ``continuation_tokens`` is empty, the
stream has finished (for example if there was an ``end_time``
specified). If ``continuation_tokens`` is present, then a change in
partitioning requires the client to open a new stream for each token
to resume reading.
stream. If status is OK and ``continuation_tokens`` &
``new_partitions`` are empty, the stream has finished (for example
if there was an ``end_time`` specified). If ``continuation_tokens``
& ``new_partitions`` are present, then a change in partitioning
requires the client to open a new stream for each token to resume
reading. Example: [B, D) ends \| v new_partitions: [A, C) [C, E)
continuation_tokens.partitions: [B,C) [C,D) ^---^ ^---^ ^ ^ \| \| \|
StreamContinuationToken 2 \| StreamContinuationToken 1 To read the
new partition [A,C), supply the continuation tokens whose ranges
cover the new partition, for example ContinuationToken[A,B) &
ContinuationToken[B,C).
Attributes:
status (google.rpc.status_pb2.Status):
The status of the stream.
continuation_tokens (MutableSequence[google.cloud.bigtable_v2.types.StreamContinuationToken]):
If non-empty, contains the information needed
to start reading the new partition(s) that
contain segments of this partition's row range.
to resume reading their associated partitions.
new_partitions (MutableSequence[google.cloud.bigtable_v2.types.StreamPartition]):
If non-empty, contains the new partitions to start reading
from, which are related to but not necessarily identical to
the partitions for the above ``continuation_tokens``.
"""

status: status_pb2.Status = proto.Field(
Expand All @@ -1079,6 +1088,11 @@ class CloseStream(proto.Message):
number=2,
message=data.StreamContinuationToken,
)
new_partitions: MutableSequence[data.StreamPartition] = proto.RepeatedField(
proto.MESSAGE,
number=3,
message=data.StreamPartition,
)

data_change: DataChange = proto.Field(
proto.MESSAGE,
Expand Down

0 comments on commit 1adcad4

Please sign in to comment.