google-cloud-bigtable 2.30.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. google/cloud/bigtable/__init__.py +25 -0
  2. google/cloud/bigtable/app_profile.py +377 -0
  3. google/cloud/bigtable/backup.py +490 -0
  4. google/cloud/bigtable/batcher.py +414 -0
  5. google/cloud/bigtable/client.py +475 -0
  6. google/cloud/bigtable/cluster.py +541 -0
  7. google/cloud/bigtable/column_family.py +362 -0
  8. google/cloud/bigtable/data/__init__.py +103 -0
  9. google/cloud/bigtable/data/_async/__init__.py +25 -0
  10. google/cloud/bigtable/data/_async/_mutate_rows.py +226 -0
  11. google/cloud/bigtable/data/_async/_read_rows.py +363 -0
  12. google/cloud/bigtable/data/_async/client.py +1522 -0
  13. google/cloud/bigtable/data/_async/mutations_batcher.py +534 -0
  14. google/cloud/bigtable/data/_cross_sync/__init__.py +20 -0
  15. google/cloud/bigtable/data/_cross_sync/_decorators.py +441 -0
  16. google/cloud/bigtable/data/_cross_sync/_mapping_meta.py +64 -0
  17. google/cloud/bigtable/data/_cross_sync/cross_sync.py +334 -0
  18. google/cloud/bigtable/data/_helpers.py +249 -0
  19. google/cloud/bigtable/data/_sync_autogen/_mutate_rows.py +182 -0
  20. google/cloud/bigtable/data/_sync_autogen/_read_rows.py +304 -0
  21. google/cloud/bigtable/data/_sync_autogen/client.py +1293 -0
  22. google/cloud/bigtable/data/_sync_autogen/mutations_batcher.py +449 -0
  23. google/cloud/bigtable/data/exceptions.py +340 -0
  24. google/cloud/bigtable/data/execute_query/__init__.py +43 -0
  25. google/cloud/bigtable/data/execute_query/_async/__init__.py +13 -0
  26. google/cloud/bigtable/data/execute_query/_async/execute_query_iterator.py +291 -0
  27. google/cloud/bigtable/data/execute_query/_byte_cursor.py +123 -0
  28. google/cloud/bigtable/data/execute_query/_checksum.py +43 -0
  29. google/cloud/bigtable/data/execute_query/_parameters_formatting.py +155 -0
  30. google/cloud/bigtable/data/execute_query/_query_result_parsing_utils.py +134 -0
  31. google/cloud/bigtable/data/execute_query/_reader.py +122 -0
  32. google/cloud/bigtable/data/execute_query/_sync_autogen/execute_query_iterator.py +239 -0
  33. google/cloud/bigtable/data/execute_query/metadata.py +399 -0
  34. google/cloud/bigtable/data/execute_query/values.py +123 -0
  35. google/cloud/bigtable/data/mutations.py +380 -0
  36. google/cloud/bigtable/data/read_modify_write_rules.py +112 -0
  37. google/cloud/bigtable/data/read_rows_query.py +536 -0
  38. google/cloud/bigtable/data/row.py +535 -0
  39. google/cloud/bigtable/data/row_filters.py +968 -0
  40. google/cloud/bigtable/encryption_info.py +64 -0
  41. google/cloud/bigtable/enums.py +223 -0
  42. google/cloud/bigtable/error.py +64 -0
  43. google/cloud/bigtable/gapic_version.py +16 -0
  44. google/cloud/bigtable/helpers.py +31 -0
  45. google/cloud/bigtable/instance.py +789 -0
  46. google/cloud/bigtable/policy.py +255 -0
  47. google/cloud/bigtable/row.py +1267 -0
  48. google/cloud/bigtable/row_data.py +380 -0
  49. google/cloud/bigtable/row_filters.py +838 -0
  50. google/cloud/bigtable/row_merger.py +250 -0
  51. google/cloud/bigtable/row_set.py +213 -0
  52. google/cloud/bigtable/table.py +1409 -0
  53. google/cloud/bigtable_admin/__init__.py +410 -0
  54. google/cloud/bigtable_admin/gapic_version.py +16 -0
  55. google/cloud/bigtable_admin/py.typed +2 -0
  56. google/cloud/bigtable_admin_v2/__init__.py +250 -0
  57. google/cloud/bigtable_admin_v2/gapic_metadata.json +962 -0
  58. google/cloud/bigtable_admin_v2/gapic_version.py +16 -0
  59. google/cloud/bigtable_admin_v2/py.typed +2 -0
  60. google/cloud/bigtable_admin_v2/services/__init__.py +15 -0
  61. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/__init__.py +22 -0
  62. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/async_client.py +3465 -0
  63. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/client.py +3944 -0
  64. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/pagers.py +681 -0
  65. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/__init__.py +40 -0
  66. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/base.py +751 -0
  67. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc.py +1249 -0
  68. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc_asyncio.py +1579 -0
  69. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest.py +6820 -0
  70. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest_base.py +1746 -0
  71. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/__init__.py +22 -0
  72. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/async_client.py +3472 -0
  73. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/client.py +3949 -0
  74. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/pagers.py +669 -0
  75. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/__init__.py +40 -0
  76. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/base.py +708 -0
  77. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc.py +1257 -0
  78. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc_asyncio.py +1549 -0
  79. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest.py +6609 -0
  80. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest_base.py +1714 -0
  81. google/cloud/bigtable_admin_v2/types/__init__.py +248 -0
  82. google/cloud/bigtable_admin_v2/types/bigtable_instance_admin.py +1364 -0
  83. google/cloud/bigtable_admin_v2/types/bigtable_table_admin.py +1715 -0
  84. google/cloud/bigtable_admin_v2/types/common.py +81 -0
  85. google/cloud/bigtable_admin_v2/types/instance.py +819 -0
  86. google/cloud/bigtable_admin_v2/types/table.py +1028 -0
  87. google/cloud/bigtable_admin_v2/types/types.py +776 -0
  88. google/cloud/bigtable_v2/__init__.py +136 -0
  89. google/cloud/bigtable_v2/gapic_metadata.json +193 -0
  90. google/cloud/bigtable_v2/gapic_version.py +16 -0
  91. google/cloud/bigtable_v2/py.typed +2 -0
  92. google/cloud/bigtable_v2/services/__init__.py +15 -0
  93. google/cloud/bigtable_v2/services/bigtable/__init__.py +22 -0
  94. google/cloud/bigtable_v2/services/bigtable/async_client.py +1741 -0
  95. google/cloud/bigtable_v2/services/bigtable/client.py +2194 -0
  96. google/cloud/bigtable_v2/services/bigtable/transports/__init__.py +38 -0
  97. google/cloud/bigtable_v2/services/bigtable/transports/base.py +343 -0
  98. google/cloud/bigtable_v2/services/bigtable/transports/grpc.py +660 -0
  99. google/cloud/bigtable_v2/services/bigtable/transports/grpc_asyncio.py +762 -0
  100. google/cloud/bigtable_v2/services/bigtable/transports/rest.py +2489 -0
  101. google/cloud/bigtable_v2/services/bigtable/transports/rest_base.py +711 -0
  102. google/cloud/bigtable_v2/types/__init__.py +138 -0
  103. google/cloud/bigtable_v2/types/bigtable.py +1531 -0
  104. google/cloud/bigtable_v2/types/data.py +1612 -0
  105. google/cloud/bigtable_v2/types/feature_flags.py +119 -0
  106. google/cloud/bigtable_v2/types/request_stats.py +171 -0
  107. google/cloud/bigtable_v2/types/response_params.py +64 -0
  108. google/cloud/bigtable_v2/types/types.py +579 -0
  109. google_cloud_bigtable-2.30.0.data/scripts/fixup_bigtable_admin_v2_keywords.py +233 -0
  110. google_cloud_bigtable-2.30.0.data/scripts/fixup_bigtable_v2_keywords.py +186 -0
  111. google_cloud_bigtable-2.30.0.dist-info/LICENSE +202 -0
  112. google_cloud_bigtable-2.30.0.dist-info/METADATA +154 -0
  113. google_cloud_bigtable-2.30.0.dist-info/RECORD +115 -0
  114. google_cloud_bigtable-2.30.0.dist-info/WHEEL +5 -0
  115. google_cloud_bigtable-2.30.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1531 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ from __future__ import annotations
17
+
18
+ from typing import MutableMapping, MutableSequence
19
+
20
+ import proto # type: ignore
21
+
22
+ from google.cloud.bigtable_v2.types import data
23
+ from google.cloud.bigtable_v2.types import request_stats as gb_request_stats
24
+ from google.cloud.bigtable_v2.types import types
25
+ from google.protobuf import duration_pb2 # type: ignore
26
+ from google.protobuf import timestamp_pb2 # type: ignore
27
+ from google.protobuf import wrappers_pb2 # type: ignore
28
+ from google.rpc import status_pb2 # type: ignore
29
+
30
+
31
+ __protobuf__ = proto.module(
32
+ package="google.bigtable.v2",
33
+ manifest={
34
+ "ReadRowsRequest",
35
+ "ReadRowsResponse",
36
+ "SampleRowKeysRequest",
37
+ "SampleRowKeysResponse",
38
+ "MutateRowRequest",
39
+ "MutateRowResponse",
40
+ "MutateRowsRequest",
41
+ "MutateRowsResponse",
42
+ "RateLimitInfo",
43
+ "CheckAndMutateRowRequest",
44
+ "CheckAndMutateRowResponse",
45
+ "PingAndWarmRequest",
46
+ "PingAndWarmResponse",
47
+ "ReadModifyWriteRowRequest",
48
+ "ReadModifyWriteRowResponse",
49
+ "GenerateInitialChangeStreamPartitionsRequest",
50
+ "GenerateInitialChangeStreamPartitionsResponse",
51
+ "ReadChangeStreamRequest",
52
+ "ReadChangeStreamResponse",
53
+ "ExecuteQueryRequest",
54
+ "ExecuteQueryResponse",
55
+ "PrepareQueryRequest",
56
+ "PrepareQueryResponse",
57
+ },
58
+ )
59
+
60
+
61
+ class ReadRowsRequest(proto.Message):
62
+ r"""Request message for Bigtable.ReadRows.
63
+
64
+ Attributes:
65
+ table_name (str):
66
+ Optional. The unique name of the table from which to read.
67
+
68
+ Values are of the form
69
+ ``projects/<project>/instances/<instance>/tables/<table>``.
70
+ authorized_view_name (str):
71
+ Optional. The unique name of the AuthorizedView from which
72
+ to read.
73
+
74
+ Values are of the form
75
+ ``projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>``.
76
+ materialized_view_name (str):
77
+ Optional. The unique name of the MaterializedView from which
78
+ to read.
79
+
80
+ Values are of the form
81
+ ``projects/<project>/instances/<instance>/materializedViews/<materialized_view>``.
82
+ app_profile_id (str):
83
+ This value specifies routing for replication.
84
+ If not specified, the "default" application
85
+ profile will be used.
86
+ rows (google.cloud.bigtable_v2.types.RowSet):
87
+ The row keys and/or ranges to read
88
+ sequentially. If not specified, reads from all
89
+ rows.
90
+ filter (google.cloud.bigtable_v2.types.RowFilter):
91
+ The filter to apply to the contents of the
92
+ specified row(s). If unset, reads the entirety
93
+ of each row.
94
+ rows_limit (int):
95
+ The read will stop after committing to N
96
+ rows' worth of results. The default (zero) is to
97
+ return all results.
98
+ request_stats_view (google.cloud.bigtable_v2.types.ReadRowsRequest.RequestStatsView):
99
+ The view into RequestStats, as described
100
+ above.
101
+ reversed (bool):
102
+ Experimental API - Please note that this API is currently
103
+ experimental and can change in the future.
104
+
105
+ Return rows in lexiographical descending order of the row
106
+ keys. The row contents will not be affected by this flag.
107
+
108
+ Example result set:
109
+
110
+ ::
111
+
112
+ [
113
+ {key: "k2", "f:col1": "v1", "f:col2": "v1"},
114
+ {key: "k1", "f:col1": "v2", "f:col2": "v2"}
115
+ ]
116
+ """
117
+
118
+ class RequestStatsView(proto.Enum):
119
+ r"""The desired view into RequestStats that should be returned in
120
+ the response.
121
+ See also: RequestStats message.
122
+
123
+ Values:
124
+ REQUEST_STATS_VIEW_UNSPECIFIED (0):
125
+ The default / unset value. The API will
126
+ default to the NONE option below.
127
+ REQUEST_STATS_NONE (1):
128
+ Do not include any RequestStats in the
129
+ response. This will leave the RequestStats
130
+ embedded message unset in the response.
131
+ REQUEST_STATS_FULL (2):
132
+ Include the full set of available
133
+ RequestStats in the response, applicable to this
134
+ read.
135
+ """
136
+ REQUEST_STATS_VIEW_UNSPECIFIED = 0
137
+ REQUEST_STATS_NONE = 1
138
+ REQUEST_STATS_FULL = 2
139
+
140
+ table_name: str = proto.Field(
141
+ proto.STRING,
142
+ number=1,
143
+ )
144
+ authorized_view_name: str = proto.Field(
145
+ proto.STRING,
146
+ number=9,
147
+ )
148
+ materialized_view_name: str = proto.Field(
149
+ proto.STRING,
150
+ number=11,
151
+ )
152
+ app_profile_id: str = proto.Field(
153
+ proto.STRING,
154
+ number=5,
155
+ )
156
+ rows: data.RowSet = proto.Field(
157
+ proto.MESSAGE,
158
+ number=2,
159
+ message=data.RowSet,
160
+ )
161
+ filter: data.RowFilter = proto.Field(
162
+ proto.MESSAGE,
163
+ number=3,
164
+ message=data.RowFilter,
165
+ )
166
+ rows_limit: int = proto.Field(
167
+ proto.INT64,
168
+ number=4,
169
+ )
170
+ request_stats_view: RequestStatsView = proto.Field(
171
+ proto.ENUM,
172
+ number=6,
173
+ enum=RequestStatsView,
174
+ )
175
+ reversed: bool = proto.Field(
176
+ proto.BOOL,
177
+ number=7,
178
+ )
179
+
180
+
181
+ class ReadRowsResponse(proto.Message):
182
+ r"""Response message for Bigtable.ReadRows.
183
+
184
+ Attributes:
185
+ chunks (MutableSequence[google.cloud.bigtable_v2.types.ReadRowsResponse.CellChunk]):
186
+ A collection of a row's contents as part of
187
+ the read request.
188
+ last_scanned_row_key (bytes):
189
+ Optionally the server might return the row
190
+ key of the last row it has scanned. The client
191
+ can use this to construct a more efficient retry
192
+ request if needed: any row keys or portions of
193
+ ranges less than this row key can be dropped
194
+ from the request. This is primarily useful for
195
+ cases where the server has read a lot of data
196
+ that was filtered out since the last committed
197
+ row key, allowing the client to skip that work
198
+ on a retry.
199
+ request_stats (google.cloud.bigtable_v2.types.RequestStats):
200
+ If requested, provide enhanced query performance statistics.
201
+ The semantics dictate:
202
+
203
+ - request_stats is empty on every (streamed) response,
204
+ except
205
+ - request_stats has non-empty information after all chunks
206
+ have been streamed, where the ReadRowsResponse message
207
+ only contains request_stats.
208
+
209
+ - For example, if a read request would have returned an
210
+ empty response instead a single ReadRowsResponse is
211
+ streamed with empty chunks and request_stats filled.
212
+
213
+ Visually, response messages will stream as follows: ... ->
214
+ {chunks: [...]} -> {chunks: [], request_stats: {...}}
215
+ \_\ **/ \_**\ \__________/ Primary response Trailer of
216
+ RequestStats info
217
+
218
+ Or if the read did not return any values: {chunks: [],
219
+ request_stats: {...}} \________________________________/
220
+ Trailer of RequestStats info
221
+ """
222
+
223
+ class CellChunk(proto.Message):
224
+ r"""Specifies a piece of a row's contents returned as part of the
225
+ read response stream.
226
+
227
+ This message has `oneof`_ fields (mutually exclusive fields).
228
+ For each oneof, at most one member field can be set at the same time.
229
+ Setting any member of the oneof automatically clears all other
230
+ members.
231
+
232
+ .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
233
+
234
+ Attributes:
235
+ row_key (bytes):
236
+ The row key for this chunk of data. If the
237
+ row key is empty, this CellChunk is a
238
+ continuation of the same row as the previous
239
+ CellChunk in the response stream, even if that
240
+ CellChunk was in a previous ReadRowsResponse
241
+ message.
242
+ family_name (google.protobuf.wrappers_pb2.StringValue):
243
+ The column family name for this chunk of data. If this
244
+ message is not present this CellChunk is a continuation of
245
+ the same column family as the previous CellChunk. The empty
246
+ string can occur as a column family name in a response so
247
+ clients must check explicitly for the presence of this
248
+ message, not just for ``family_name.value`` being non-empty.
249
+ qualifier (google.protobuf.wrappers_pb2.BytesValue):
250
+ The column qualifier for this chunk of data. If this message
251
+ is not present, this CellChunk is a continuation of the same
252
+ column as the previous CellChunk. Column qualifiers may be
253
+ empty so clients must check for the presence of this
254
+ message, not just for ``qualifier.value`` being non-empty.
255
+ timestamp_micros (int):
256
+ The cell's stored timestamp, which also uniquely identifies
257
+ it within its column. Values are always expressed in
258
+ microseconds, but individual tables may set a coarser
259
+ granularity to further restrict the allowed values. For
260
+ example, a table which specifies millisecond granularity
261
+ will only allow values of ``timestamp_micros`` which are
262
+ multiples of 1000. Timestamps are only set in the first
263
+ CellChunk per cell (for cells split into multiple chunks).
264
+ labels (MutableSequence[str]):
265
+ Labels applied to the cell by a
266
+ [RowFilter][google.bigtable.v2.RowFilter]. Labels are only
267
+ set on the first CellChunk per cell.
268
+ value (bytes):
269
+ The value stored in the cell. Cell values
270
+ can be split across multiple CellChunks. In
271
+ that case only the value field will be set in
272
+ CellChunks after the first: the timestamp and
273
+ labels will only be present in the first
274
+ CellChunk, even if the first CellChunk came in a
275
+ previous ReadRowsResponse.
276
+ value_size (int):
277
+ If this CellChunk is part of a chunked cell value and this
278
+ is not the final chunk of that cell, value_size will be set
279
+ to the total length of the cell value. The client can use
280
+ this size to pre-allocate memory to hold the full cell
281
+ value.
282
+ reset_row (bool):
283
+ Indicates that the client should drop all previous chunks
284
+ for ``row_key``, as it will be re-read from the beginning.
285
+
286
+ This field is a member of `oneof`_ ``row_status``.
287
+ commit_row (bool):
288
+ Indicates that the client can safely process all previous
289
+ chunks for ``row_key``, as its data has been fully read.
290
+
291
+ This field is a member of `oneof`_ ``row_status``.
292
+ """
293
+
294
+ row_key: bytes = proto.Field(
295
+ proto.BYTES,
296
+ number=1,
297
+ )
298
+ family_name: wrappers_pb2.StringValue = proto.Field(
299
+ proto.MESSAGE,
300
+ number=2,
301
+ message=wrappers_pb2.StringValue,
302
+ )
303
+ qualifier: wrappers_pb2.BytesValue = proto.Field(
304
+ proto.MESSAGE,
305
+ number=3,
306
+ message=wrappers_pb2.BytesValue,
307
+ )
308
+ timestamp_micros: int = proto.Field(
309
+ proto.INT64,
310
+ number=4,
311
+ )
312
+ labels: MutableSequence[str] = proto.RepeatedField(
313
+ proto.STRING,
314
+ number=5,
315
+ )
316
+ value: bytes = proto.Field(
317
+ proto.BYTES,
318
+ number=6,
319
+ )
320
+ value_size: int = proto.Field(
321
+ proto.INT32,
322
+ number=7,
323
+ )
324
+ reset_row: bool = proto.Field(
325
+ proto.BOOL,
326
+ number=8,
327
+ oneof="row_status",
328
+ )
329
+ commit_row: bool = proto.Field(
330
+ proto.BOOL,
331
+ number=9,
332
+ oneof="row_status",
333
+ )
334
+
335
+ chunks: MutableSequence[CellChunk] = proto.RepeatedField(
336
+ proto.MESSAGE,
337
+ number=1,
338
+ message=CellChunk,
339
+ )
340
+ last_scanned_row_key: bytes = proto.Field(
341
+ proto.BYTES,
342
+ number=2,
343
+ )
344
+ request_stats: gb_request_stats.RequestStats = proto.Field(
345
+ proto.MESSAGE,
346
+ number=3,
347
+ message=gb_request_stats.RequestStats,
348
+ )
349
+
350
+
351
+ class SampleRowKeysRequest(proto.Message):
352
+ r"""Request message for Bigtable.SampleRowKeys.
353
+
354
+ Attributes:
355
+ table_name (str):
356
+ Optional. The unique name of the table from which to sample
357
+ row keys.
358
+
359
+ Values are of the form
360
+ ``projects/<project>/instances/<instance>/tables/<table>``.
361
+ authorized_view_name (str):
362
+ Optional. The unique name of the AuthorizedView from which
363
+ to sample row keys.
364
+
365
+ Values are of the form
366
+ ``projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>``.
367
+ materialized_view_name (str):
368
+ Optional. The unique name of the MaterializedView from which
369
+ to read.
370
+
371
+ Values are of the form
372
+ ``projects/<project>/instances/<instance>/materializedViews/<materialized_view>``.
373
+ app_profile_id (str):
374
+ This value specifies routing for replication.
375
+ If not specified, the "default" application
376
+ profile will be used.
377
+ """
378
+
379
+ table_name: str = proto.Field(
380
+ proto.STRING,
381
+ number=1,
382
+ )
383
+ authorized_view_name: str = proto.Field(
384
+ proto.STRING,
385
+ number=4,
386
+ )
387
+ materialized_view_name: str = proto.Field(
388
+ proto.STRING,
389
+ number=5,
390
+ )
391
+ app_profile_id: str = proto.Field(
392
+ proto.STRING,
393
+ number=2,
394
+ )
395
+
396
+
397
+ class SampleRowKeysResponse(proto.Message):
398
+ r"""Response message for Bigtable.SampleRowKeys.
399
+
400
+ Attributes:
401
+ row_key (bytes):
402
+ Sorted streamed sequence of sample row keys
403
+ in the table. The table might have contents
404
+ before the first row key in the list and after
405
+ the last one, but a key containing the empty
406
+ string indicates "end of table" and will be the
407
+ last response given, if present.
408
+ Note that row keys in this list may not have
409
+ ever been written to or read from, and users
410
+ should therefore not make any assumptions about
411
+ the row key structure that are specific to their
412
+ use case.
413
+ offset_bytes (int):
414
+ Approximate total storage space used by all rows in the
415
+ table which precede ``row_key``. Buffering the contents of
416
+ all rows between two subsequent samples would require space
417
+ roughly equal to the difference in their ``offset_bytes``
418
+ fields.
419
+ """
420
+
421
+ row_key: bytes = proto.Field(
422
+ proto.BYTES,
423
+ number=1,
424
+ )
425
+ offset_bytes: int = proto.Field(
426
+ proto.INT64,
427
+ number=2,
428
+ )
429
+
430
+
431
+ class MutateRowRequest(proto.Message):
432
+ r"""Request message for Bigtable.MutateRow.
433
+
434
+ Attributes:
435
+ table_name (str):
436
+ Optional. The unique name of the table to which the mutation
437
+ should be applied.
438
+
439
+ Values are of the form
440
+ ``projects/<project>/instances/<instance>/tables/<table>``.
441
+ authorized_view_name (str):
442
+ Optional. The unique name of the AuthorizedView to which the
443
+ mutation should be applied.
444
+
445
+ Values are of the form
446
+ ``projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>``.
447
+ app_profile_id (str):
448
+ This value specifies routing for replication.
449
+ If not specified, the "default" application
450
+ profile will be used.
451
+ row_key (bytes):
452
+ Required. The key of the row to which the
453
+ mutation should be applied.
454
+ mutations (MutableSequence[google.cloud.bigtable_v2.types.Mutation]):
455
+ Required. Changes to be atomically applied to
456
+ the specified row. Entries are applied in order,
457
+ meaning that earlier mutations can be masked by
458
+ later ones. Must contain at least one entry and
459
+ at most 100000.
460
+ """
461
+
462
+ table_name: str = proto.Field(
463
+ proto.STRING,
464
+ number=1,
465
+ )
466
+ authorized_view_name: str = proto.Field(
467
+ proto.STRING,
468
+ number=6,
469
+ )
470
+ app_profile_id: str = proto.Field(
471
+ proto.STRING,
472
+ number=4,
473
+ )
474
+ row_key: bytes = proto.Field(
475
+ proto.BYTES,
476
+ number=2,
477
+ )
478
+ mutations: MutableSequence[data.Mutation] = proto.RepeatedField(
479
+ proto.MESSAGE,
480
+ number=3,
481
+ message=data.Mutation,
482
+ )
483
+
484
+
485
+ class MutateRowResponse(proto.Message):
486
+ r"""Response message for Bigtable.MutateRow."""
487
+
488
+
489
+ class MutateRowsRequest(proto.Message):
490
+ r"""Request message for BigtableService.MutateRows.
491
+
492
+ Attributes:
493
+ table_name (str):
494
+ Optional. The unique name of the table to which the
495
+ mutations should be applied.
496
+
497
+ Values are of the form
498
+ ``projects/<project>/instances/<instance>/tables/<table>``.
499
+ authorized_view_name (str):
500
+ Optional. The unique name of the AuthorizedView to which the
501
+ mutations should be applied.
502
+
503
+ Values are of the form
504
+ ``projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>``.
505
+ app_profile_id (str):
506
+ This value specifies routing for replication.
507
+ If not specified, the "default" application
508
+ profile will be used.
509
+ entries (MutableSequence[google.cloud.bigtable_v2.types.MutateRowsRequest.Entry]):
510
+ Required. The row keys and corresponding
511
+ mutations to be applied in bulk. Each entry is
512
+ applied as an atomic mutation, but the entries
513
+ may be applied in arbitrary order (even between
514
+ entries for the same row). At least one entry
515
+ must be specified, and in total the entries can
516
+ contain at most 100000 mutations.
517
+ """
518
+
519
+ class Entry(proto.Message):
520
+ r"""A mutation for a given row.
521
+
522
+ Attributes:
523
+ row_key (bytes):
524
+ The key of the row to which the ``mutations`` should be
525
+ applied.
526
+ mutations (MutableSequence[google.cloud.bigtable_v2.types.Mutation]):
527
+ Required. Changes to be atomically applied to
528
+ the specified row. Mutations are applied in
529
+ order, meaning that earlier mutations can be
530
+ masked by later ones. You must specify at least
531
+ one mutation.
532
+ """
533
+
534
+ row_key: bytes = proto.Field(
535
+ proto.BYTES,
536
+ number=1,
537
+ )
538
+ mutations: MutableSequence[data.Mutation] = proto.RepeatedField(
539
+ proto.MESSAGE,
540
+ number=2,
541
+ message=data.Mutation,
542
+ )
543
+
544
+ table_name: str = proto.Field(
545
+ proto.STRING,
546
+ number=1,
547
+ )
548
+ authorized_view_name: str = proto.Field(
549
+ proto.STRING,
550
+ number=5,
551
+ )
552
+ app_profile_id: str = proto.Field(
553
+ proto.STRING,
554
+ number=3,
555
+ )
556
+ entries: MutableSequence[Entry] = proto.RepeatedField(
557
+ proto.MESSAGE,
558
+ number=2,
559
+ message=Entry,
560
+ )
561
+
562
+
563
+ class MutateRowsResponse(proto.Message):
564
+ r"""Response message for BigtableService.MutateRows.
565
+
566
+ .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
567
+
568
+ Attributes:
569
+ entries (MutableSequence[google.cloud.bigtable_v2.types.MutateRowsResponse.Entry]):
570
+ One or more results for Entries from the
571
+ batch request.
572
+ rate_limit_info (google.cloud.bigtable_v2.types.RateLimitInfo):
573
+ Information about how client should limit the
574
+ rate (QPS). Primirily used by supported official
575
+ Cloud Bigtable clients. If unset, the rate limit
576
+ info is not provided by the server.
577
+
578
+ This field is a member of `oneof`_ ``_rate_limit_info``.
579
+ """
580
+
581
+ class Entry(proto.Message):
582
+ r"""The result of applying a passed mutation in the original
583
+ request.
584
+
585
+ Attributes:
586
+ index (int):
587
+ The index into the original request's ``entries`` list of
588
+ the Entry for which a result is being reported.
589
+ status (google.rpc.status_pb2.Status):
590
+ The result of the request Entry identified by ``index``.
591
+ Depending on how requests are batched during execution, it
592
+ is possible for one Entry to fail due to an error with
593
+ another Entry. In the event that this occurs, the same error
594
+ will be reported for both entries.
595
+ """
596
+
597
+ index: int = proto.Field(
598
+ proto.INT64,
599
+ number=1,
600
+ )
601
+ status: status_pb2.Status = proto.Field(
602
+ proto.MESSAGE,
603
+ number=2,
604
+ message=status_pb2.Status,
605
+ )
606
+
607
+ entries: MutableSequence[Entry] = proto.RepeatedField(
608
+ proto.MESSAGE,
609
+ number=1,
610
+ message=Entry,
611
+ )
612
+ rate_limit_info: "RateLimitInfo" = proto.Field(
613
+ proto.MESSAGE,
614
+ number=3,
615
+ optional=True,
616
+ message="RateLimitInfo",
617
+ )
618
+
619
+
620
+ class RateLimitInfo(proto.Message):
621
+ r"""Information about how client should adjust the load to
622
+ Bigtable.
623
+
624
+ Attributes:
625
+ period (google.protobuf.duration_pb2.Duration):
626
+ Time that clients should wait before
627
+ adjusting the target rate again. If clients
628
+ adjust rate too frequently, the impact of the
629
+ previous adjustment may not have been taken into
630
+ account and may over-throttle or under-throttle.
631
+ If clients adjust rate too slowly, they will not
632
+ be responsive to load changes on server side,
633
+ and may over-throttle or under-throttle.
634
+ factor (float):
635
+ If it has been at least one ``period`` since the last load
636
+ adjustment, the client should multiply the current load by
637
+ this value to get the new target load. For example, if the
638
+ current load is 100 and ``factor`` is 0.8, the new target
639
+ load should be 80. After adjusting, the client should ignore
640
+ ``factor`` until another ``period`` has passed.
641
+
642
+ The client can measure its load using any unit that's
643
+ comparable over time For example, QPS can be used as long as
644
+ each request involves a similar amount of work.
645
+ """
646
+
647
+ period: duration_pb2.Duration = proto.Field(
648
+ proto.MESSAGE,
649
+ number=1,
650
+ message=duration_pb2.Duration,
651
+ )
652
+ factor: float = proto.Field(
653
+ proto.DOUBLE,
654
+ number=2,
655
+ )
656
+
657
+
658
+ class CheckAndMutateRowRequest(proto.Message):
659
+ r"""Request message for Bigtable.CheckAndMutateRow.
660
+
661
+ Attributes:
662
+ table_name (str):
663
+ Optional. The unique name of the table to which the
664
+ conditional mutation should be applied.
665
+
666
+ Values are of the form
667
+ ``projects/<project>/instances/<instance>/tables/<table>``.
668
+ authorized_view_name (str):
669
+ Optional. The unique name of the AuthorizedView to which the
670
+ conditional mutation should be applied.
671
+
672
+ Values are of the form
673
+ ``projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>``.
674
+ app_profile_id (str):
675
+ This value specifies routing for replication.
676
+ If not specified, the "default" application
677
+ profile will be used.
678
+ row_key (bytes):
679
+ Required. The key of the row to which the
680
+ conditional mutation should be applied.
681
+ predicate_filter (google.cloud.bigtable_v2.types.RowFilter):
682
+ The filter to be applied to the contents of the specified
683
+ row. Depending on whether or not any results are yielded,
684
+ either ``true_mutations`` or ``false_mutations`` will be
685
+ executed. If unset, checks that the row contains any values
686
+ at all.
687
+ true_mutations (MutableSequence[google.cloud.bigtable_v2.types.Mutation]):
688
+ Changes to be atomically applied to the specified row if
689
+ ``predicate_filter`` yields at least one cell when applied
690
+ to ``row_key``. Entries are applied in order, meaning that
691
+ earlier mutations can be masked by later ones. Must contain
692
+ at least one entry if ``false_mutations`` is empty, and at
693
+ most 100000.
694
+ false_mutations (MutableSequence[google.cloud.bigtable_v2.types.Mutation]):
695
+ Changes to be atomically applied to the specified row if
696
+ ``predicate_filter`` does not yield any cells when applied
697
+ to ``row_key``. Entries are applied in order, meaning that
698
+ earlier mutations can be masked by later ones. Must contain
699
+ at least one entry if ``true_mutations`` is empty, and at
700
+ most 100000.
701
+ """
702
+
703
+ table_name: str = proto.Field(
704
+ proto.STRING,
705
+ number=1,
706
+ )
707
+ authorized_view_name: str = proto.Field(
708
+ proto.STRING,
709
+ number=9,
710
+ )
711
+ app_profile_id: str = proto.Field(
712
+ proto.STRING,
713
+ number=7,
714
+ )
715
+ row_key: bytes = proto.Field(
716
+ proto.BYTES,
717
+ number=2,
718
+ )
719
+ predicate_filter: data.RowFilter = proto.Field(
720
+ proto.MESSAGE,
721
+ number=6,
722
+ message=data.RowFilter,
723
+ )
724
+ true_mutations: MutableSequence[data.Mutation] = proto.RepeatedField(
725
+ proto.MESSAGE,
726
+ number=4,
727
+ message=data.Mutation,
728
+ )
729
+ false_mutations: MutableSequence[data.Mutation] = proto.RepeatedField(
730
+ proto.MESSAGE,
731
+ number=5,
732
+ message=data.Mutation,
733
+ )
734
+
735
+
736
+ class CheckAndMutateRowResponse(proto.Message):
737
+ r"""Response message for Bigtable.CheckAndMutateRow.
738
+
739
+ Attributes:
740
+ predicate_matched (bool):
741
+ Whether or not the request's ``predicate_filter`` yielded
742
+ any results for the specified row.
743
+ """
744
+
745
+ predicate_matched: bool = proto.Field(
746
+ proto.BOOL,
747
+ number=1,
748
+ )
749
+
750
+
751
+ class PingAndWarmRequest(proto.Message):
752
+ r"""Request message for client connection keep-alive and warming.
753
+
754
+ Attributes:
755
+ name (str):
756
+ Required. The unique name of the instance to check
757
+ permissions for as well as respond. Values are of the form
758
+ ``projects/<project>/instances/<instance>``.
759
+ app_profile_id (str):
760
+ This value specifies routing for replication.
761
+ If not specified, the "default" application
762
+ profile will be used.
763
+ """
764
+
765
+ name: str = proto.Field(
766
+ proto.STRING,
767
+ number=1,
768
+ )
769
+ app_profile_id: str = proto.Field(
770
+ proto.STRING,
771
+ number=2,
772
+ )
773
+
774
+
775
+ class PingAndWarmResponse(proto.Message):
776
+ r"""Response message for Bigtable.PingAndWarm connection
777
+ keepalive and warming.
778
+
779
+ """
780
+
781
+
782
+ class ReadModifyWriteRowRequest(proto.Message):
783
+ r"""Request message for Bigtable.ReadModifyWriteRow.
784
+
785
+ Attributes:
786
+ table_name (str):
787
+ Optional. The unique name of the table to which the
788
+ read/modify/write rules should be applied.
789
+
790
+ Values are of the form
791
+ ``projects/<project>/instances/<instance>/tables/<table>``.
792
+ authorized_view_name (str):
793
+ Optional. The unique name of the AuthorizedView to which the
794
+ read/modify/write rules should be applied.
795
+
796
+ Values are of the form
797
+ ``projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>``.
798
+ app_profile_id (str):
799
+ This value specifies routing for replication.
800
+ If not specified, the "default" application
801
+ profile will be used.
802
+ row_key (bytes):
803
+ Required. The key of the row to which the
804
+ read/modify/write rules should be applied.
805
+ rules (MutableSequence[google.cloud.bigtable_v2.types.ReadModifyWriteRule]):
806
+ Required. Rules specifying how the specified
807
+ row's contents are to be transformed into
808
+ writes. Entries are applied in order, meaning
809
+ that earlier rules will affect the results of
810
+ later ones.
811
+ """
812
+
813
+ table_name: str = proto.Field(
814
+ proto.STRING,
815
+ number=1,
816
+ )
817
+ authorized_view_name: str = proto.Field(
818
+ proto.STRING,
819
+ number=6,
820
+ )
821
+ app_profile_id: str = proto.Field(
822
+ proto.STRING,
823
+ number=4,
824
+ )
825
+ row_key: bytes = proto.Field(
826
+ proto.BYTES,
827
+ number=2,
828
+ )
829
+ rules: MutableSequence[data.ReadModifyWriteRule] = proto.RepeatedField(
830
+ proto.MESSAGE,
831
+ number=3,
832
+ message=data.ReadModifyWriteRule,
833
+ )
834
+
835
+
836
+ class ReadModifyWriteRowResponse(proto.Message):
837
+ r"""Response message for Bigtable.ReadModifyWriteRow.
838
+
839
+ Attributes:
840
+ row (google.cloud.bigtable_v2.types.Row):
841
+ A Row containing the new contents of all
842
+ cells modified by the request.
843
+ """
844
+
845
+ row: data.Row = proto.Field(
846
+ proto.MESSAGE,
847
+ number=1,
848
+ message=data.Row,
849
+ )
850
+
851
+
852
+ class GenerateInitialChangeStreamPartitionsRequest(proto.Message):
853
+ r"""NOTE: This API is intended to be used by Apache Beam
854
+ BigtableIO. Request message for
855
+ Bigtable.GenerateInitialChangeStreamPartitions.
856
+
857
+ Attributes:
858
+ table_name (str):
859
+ Required. The unique name of the table from which to get
860
+ change stream partitions. Values are of the form
861
+ ``projects/<project>/instances/<instance>/tables/<table>``.
862
+ Change streaming must be enabled on the table.
863
+ app_profile_id (str):
864
+ This value specifies routing for replication.
865
+ If not specified, the "default" application
866
+ profile will be used. Single cluster routing
867
+ must be configured on the profile.
868
+ """
869
+
870
+ table_name: str = proto.Field(
871
+ proto.STRING,
872
+ number=1,
873
+ )
874
+ app_profile_id: str = proto.Field(
875
+ proto.STRING,
876
+ number=2,
877
+ )
878
+
879
+
880
+ class GenerateInitialChangeStreamPartitionsResponse(proto.Message):
881
+ r"""NOTE: This API is intended to be used by Apache Beam
882
+ BigtableIO. Response message for
883
+ Bigtable.GenerateInitialChangeStreamPartitions.
884
+
885
+ Attributes:
886
+ partition (google.cloud.bigtable_v2.types.StreamPartition):
887
+ A partition of the change stream.
888
+ """
889
+
890
+ partition: data.StreamPartition = proto.Field(
891
+ proto.MESSAGE,
892
+ number=1,
893
+ message=data.StreamPartition,
894
+ )
895
+
896
+
897
+ class ReadChangeStreamRequest(proto.Message):
898
+ r"""NOTE: This API is intended to be used by Apache Beam
899
+ BigtableIO. Request message for Bigtable.ReadChangeStream.
900
+
901
+ This message has `oneof`_ fields (mutually exclusive fields).
902
+ For each oneof, at most one member field can be set at the same time.
903
+ Setting any member of the oneof automatically clears all other
904
+ members.
905
+
906
+ .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
907
+
908
+ Attributes:
909
+ table_name (str):
910
+ Required. The unique name of the table from which to read a
911
+ change stream. Values are of the form
912
+ ``projects/<project>/instances/<instance>/tables/<table>``.
913
+ Change streaming must be enabled on the table.
914
+ app_profile_id (str):
915
+ This value specifies routing for replication.
916
+ If not specified, the "default" application
917
+ profile will be used. Single cluster routing
918
+ must be configured on the profile.
919
+ partition (google.cloud.bigtable_v2.types.StreamPartition):
920
+ The partition to read changes from.
921
+ start_time (google.protobuf.timestamp_pb2.Timestamp):
922
+ Start reading the stream at the specified
923
+ timestamp. This timestamp must be within the
924
+ change stream retention period, less than or
925
+ equal to the current time, and after change
926
+ stream creation, whichever is greater. This
927
+ value is inclusive and will be truncated to
928
+ microsecond granularity.
929
+
930
+ This field is a member of `oneof`_ ``start_from``.
931
+ continuation_tokens (google.cloud.bigtable_v2.types.StreamContinuationTokens):
932
+ Tokens that describe how to resume reading a stream where
933
+ reading previously left off. If specified, changes will be
934
+ read starting at the the position. Tokens are delivered on
935
+ the stream as part of ``Heartbeat`` and ``CloseStream``
936
+ messages.
937
+
938
+ If a single token is provided, the token’s partition must
939
+ exactly match the request’s partition. If multiple tokens
940
+ are provided, as in the case of a partition merge, the union
941
+ of the token partitions must exactly cover the request’s
942
+ partition. Otherwise, INVALID_ARGUMENT will be returned.
943
+
944
+ This field is a member of `oneof`_ ``start_from``.
945
+ end_time (google.protobuf.timestamp_pb2.Timestamp):
946
+ If specified, OK will be returned when the
947
+ stream advances beyond this time. Otherwise,
948
+ changes will be continuously delivered on the
949
+ stream. This value is inclusive and will be
950
+ truncated to microsecond granularity.
951
+ heartbeat_duration (google.protobuf.duration_pb2.Duration):
952
+ If specified, the duration between ``Heartbeat`` messages on
953
+ the stream. Otherwise, defaults to 5 seconds.
954
+ """
955
+
956
+ table_name: str = proto.Field(
957
+ proto.STRING,
958
+ number=1,
959
+ )
960
+ app_profile_id: str = proto.Field(
961
+ proto.STRING,
962
+ number=2,
963
+ )
964
+ partition: data.StreamPartition = proto.Field(
965
+ proto.MESSAGE,
966
+ number=3,
967
+ message=data.StreamPartition,
968
+ )
969
+ start_time: timestamp_pb2.Timestamp = proto.Field(
970
+ proto.MESSAGE,
971
+ number=4,
972
+ oneof="start_from",
973
+ message=timestamp_pb2.Timestamp,
974
+ )
975
+ continuation_tokens: data.StreamContinuationTokens = proto.Field(
976
+ proto.MESSAGE,
977
+ number=6,
978
+ oneof="start_from",
979
+ message=data.StreamContinuationTokens,
980
+ )
981
+ end_time: timestamp_pb2.Timestamp = proto.Field(
982
+ proto.MESSAGE,
983
+ number=5,
984
+ message=timestamp_pb2.Timestamp,
985
+ )
986
+ heartbeat_duration: duration_pb2.Duration = proto.Field(
987
+ proto.MESSAGE,
988
+ number=7,
989
+ message=duration_pb2.Duration,
990
+ )
991
+
992
+
993
+ class ReadChangeStreamResponse(proto.Message):
994
+ r"""NOTE: This API is intended to be used by Apache Beam
995
+ BigtableIO. Response message for Bigtable.ReadChangeStream.
996
+
997
+ This message has `oneof`_ fields (mutually exclusive fields).
998
+ For each oneof, at most one member field can be set at the same time.
999
+ Setting any member of the oneof automatically clears all other
1000
+ members.
1001
+
1002
+ .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
1003
+
1004
+ Attributes:
1005
+ data_change (google.cloud.bigtable_v2.types.ReadChangeStreamResponse.DataChange):
1006
+ A mutation to the partition.
1007
+
1008
+ This field is a member of `oneof`_ ``stream_record``.
1009
+ heartbeat (google.cloud.bigtable_v2.types.ReadChangeStreamResponse.Heartbeat):
1010
+ A periodic heartbeat message.
1011
+
1012
+ This field is a member of `oneof`_ ``stream_record``.
1013
+ close_stream (google.cloud.bigtable_v2.types.ReadChangeStreamResponse.CloseStream):
1014
+ An indication that the stream should be
1015
+ closed.
1016
+
1017
+ This field is a member of `oneof`_ ``stream_record``.
1018
+ """
1019
+
1020
+ class MutationChunk(proto.Message):
1021
+ r"""A partial or complete mutation.
1022
+
1023
+ Attributes:
1024
+ chunk_info (google.cloud.bigtable_v2.types.ReadChangeStreamResponse.MutationChunk.ChunkInfo):
1025
+ If set, then the mutation is a ``SetCell`` with a chunked
1026
+ value across multiple messages.
1027
+ mutation (google.cloud.bigtable_v2.types.Mutation):
1028
+ If this is a continuation of a chunked message
1029
+ (``chunked_value_offset`` > 0), ignore all fields except the
1030
+ ``SetCell``'s value and merge it with the previous message
1031
+ by concatenating the value fields.
1032
+ """
1033
+
1034
+ class ChunkInfo(proto.Message):
1035
+ r"""Information about the chunking of this mutation. Only ``SetCell``
1036
+ mutations can be chunked, and all chunks for a ``SetCell`` will be
1037
+ delivered contiguously with no other mutation types interleaved.
1038
+
1039
+ Attributes:
1040
+ chunked_value_size (int):
1041
+ The total value size of all the chunks that make up the
1042
+ ``SetCell``.
1043
+ chunked_value_offset (int):
1044
+ The byte offset of this chunk into the total
1045
+ value size of the mutation.
1046
+ last_chunk (bool):
1047
+ When true, this is the last chunk of a chunked ``SetCell``.
1048
+ """
1049
+
1050
+ chunked_value_size: int = proto.Field(
1051
+ proto.INT32,
1052
+ number=1,
1053
+ )
1054
+ chunked_value_offset: int = proto.Field(
1055
+ proto.INT32,
1056
+ number=2,
1057
+ )
1058
+ last_chunk: bool = proto.Field(
1059
+ proto.BOOL,
1060
+ number=3,
1061
+ )
1062
+
1063
+ chunk_info: "ReadChangeStreamResponse.MutationChunk.ChunkInfo" = proto.Field(
1064
+ proto.MESSAGE,
1065
+ number=1,
1066
+ message="ReadChangeStreamResponse.MutationChunk.ChunkInfo",
1067
+ )
1068
+ mutation: data.Mutation = proto.Field(
1069
+ proto.MESSAGE,
1070
+ number=2,
1071
+ message=data.Mutation,
1072
+ )
1073
+
1074
+ class DataChange(proto.Message):
1075
+ r"""A message corresponding to one or more mutations to the partition
1076
+ being streamed. A single logical ``DataChange`` message may also be
1077
+ split across a sequence of multiple individual messages. Messages
1078
+ other than the first in a sequence will only have the ``type`` and
1079
+ ``chunks`` fields populated, with the final message in the sequence
1080
+ also containing ``done`` set to true.
1081
+
1082
+ Attributes:
1083
+ type_ (google.cloud.bigtable_v2.types.ReadChangeStreamResponse.DataChange.Type):
1084
+ The type of the mutation.
1085
+ source_cluster_id (str):
1086
+ The cluster where the mutation was applied. Not set when
1087
+ ``type`` is ``GARBAGE_COLLECTION``.
1088
+ row_key (bytes):
1089
+ The row key for all mutations that are part of this
1090
+ ``DataChange``. If the ``DataChange`` is chunked across
1091
+ multiple messages, then this field will only be set for the
1092
+ first message.
1093
+ commit_timestamp (google.protobuf.timestamp_pb2.Timestamp):
1094
+ The timestamp at which the mutation was
1095
+ applied on the Bigtable server.
1096
+ tiebreaker (int):
1097
+ A value that lets stream consumers reconstruct Bigtable's
1098
+ conflict resolution semantics.
1099
+ https://cloud.google.com/bigtable/docs/writes#conflict-resolution
1100
+ In the event that the same row key, column family, column
1101
+ qualifier, timestamp are modified on different clusters at
1102
+ the same ``commit_timestamp``, the mutation with the larger
1103
+ ``tiebreaker`` will be the one chosen for the eventually
1104
+ consistent state of the system.
1105
+ chunks (MutableSequence[google.cloud.bigtable_v2.types.ReadChangeStreamResponse.MutationChunk]):
1106
+ The mutations associated with this change to the partition.
1107
+ May contain complete mutations or chunks of a multi-message
1108
+ chunked ``DataChange`` record.
1109
+ done (bool):
1110
+ When true, indicates that the entire ``DataChange`` has been
1111
+ read and the client can safely process the message.
1112
+ token (str):
1113
+ An encoded position for this stream's
1114
+ partition to restart reading from. This token is
1115
+ for the StreamPartition from the request.
1116
+ estimated_low_watermark (google.protobuf.timestamp_pb2.Timestamp):
1117
+ An estimate of the commit timestamp that is
1118
+ usually lower than or equal to any timestamp for
1119
+ a record that will be delivered in the future on
1120
+ the stream. It is possible that, under
1121
+ particular circumstances that a future record
1122
+ has a timestamp is is lower than a previously
1123
+ seen timestamp. For an example usage see
1124
+ https://beam.apache.org/documentation/basics/#watermarks
1125
+ """
1126
+
1127
+ class Type(proto.Enum):
1128
+ r"""The type of mutation.
1129
+
1130
+ Values:
1131
+ TYPE_UNSPECIFIED (0):
1132
+ The type is unspecified.
1133
+ USER (1):
1134
+ A user-initiated mutation.
1135
+ GARBAGE_COLLECTION (2):
1136
+ A system-initiated mutation as part of
1137
+ garbage collection.
1138
+ https://cloud.google.com/bigtable/docs/garbage-collection
1139
+ CONTINUATION (3):
1140
+ This is a continuation of a multi-message
1141
+ change.
1142
+ """
1143
+ TYPE_UNSPECIFIED = 0
1144
+ USER = 1
1145
+ GARBAGE_COLLECTION = 2
1146
+ CONTINUATION = 3
1147
+
1148
+ type_: "ReadChangeStreamResponse.DataChange.Type" = proto.Field(
1149
+ proto.ENUM,
1150
+ number=1,
1151
+ enum="ReadChangeStreamResponse.DataChange.Type",
1152
+ )
1153
+ source_cluster_id: str = proto.Field(
1154
+ proto.STRING,
1155
+ number=2,
1156
+ )
1157
+ row_key: bytes = proto.Field(
1158
+ proto.BYTES,
1159
+ number=3,
1160
+ )
1161
+ commit_timestamp: timestamp_pb2.Timestamp = proto.Field(
1162
+ proto.MESSAGE,
1163
+ number=4,
1164
+ message=timestamp_pb2.Timestamp,
1165
+ )
1166
+ tiebreaker: int = proto.Field(
1167
+ proto.INT32,
1168
+ number=5,
1169
+ )
1170
+ chunks: MutableSequence[
1171
+ "ReadChangeStreamResponse.MutationChunk"
1172
+ ] = proto.RepeatedField(
1173
+ proto.MESSAGE,
1174
+ number=6,
1175
+ message="ReadChangeStreamResponse.MutationChunk",
1176
+ )
1177
+ done: bool = proto.Field(
1178
+ proto.BOOL,
1179
+ number=8,
1180
+ )
1181
+ token: str = proto.Field(
1182
+ proto.STRING,
1183
+ number=9,
1184
+ )
1185
+ estimated_low_watermark: timestamp_pb2.Timestamp = proto.Field(
1186
+ proto.MESSAGE,
1187
+ number=10,
1188
+ message=timestamp_pb2.Timestamp,
1189
+ )
1190
+
1191
+ class Heartbeat(proto.Message):
1192
+ r"""A periodic message with information that can be used to
1193
+ checkpoint the state of a stream.
1194
+
1195
+ Attributes:
1196
+ continuation_token (google.cloud.bigtable_v2.types.StreamContinuationToken):
1197
+ A token that can be provided to a subsequent
1198
+ ``ReadChangeStream`` call to pick up reading at the current
1199
+ stream position.
1200
+ estimated_low_watermark (google.protobuf.timestamp_pb2.Timestamp):
1201
+ An estimate of the commit timestamp that is
1202
+ usually lower than or equal to any timestamp for
1203
+ a record that will be delivered in the future on
1204
+ the stream. It is possible that, under
1205
+ particular circumstances that a future record
1206
+ has a timestamp is is lower than a previously
1207
+ seen timestamp. For an example usage see
1208
+ https://beam.apache.org/documentation/basics/#watermarks
1209
+ """
1210
+
1211
+ continuation_token: data.StreamContinuationToken = proto.Field(
1212
+ proto.MESSAGE,
1213
+ number=1,
1214
+ message=data.StreamContinuationToken,
1215
+ )
1216
+ estimated_low_watermark: timestamp_pb2.Timestamp = proto.Field(
1217
+ proto.MESSAGE,
1218
+ number=2,
1219
+ message=timestamp_pb2.Timestamp,
1220
+ )
1221
+
1222
+ class CloseStream(proto.Message):
1223
+ r"""A message indicating that the client should stop reading from the
1224
+ stream. If status is OK and ``continuation_tokens`` &
1225
+ ``new_partitions`` are empty, the stream has finished (for example
1226
+ if there was an ``end_time`` specified). If ``continuation_tokens``
1227
+ & ``new_partitions`` are present, then a change in partitioning
1228
+ requires the client to open a new stream for each token to resume
1229
+ reading. Example: [B, D) ends \| v new_partitions: [A, C) [C, E)
1230
+ continuation_tokens.partitions: [B,C) [C,D) ^---^ ^---^ ^ ^ \| \| \|
1231
+ StreamContinuationToken 2 \| StreamContinuationToken 1 To read the
1232
+ new partition [A,C), supply the continuation tokens whose ranges
1233
+ cover the new partition, for example ContinuationToken[A,B) &
1234
+ ContinuationToken[B,C).
1235
+
1236
+ Attributes:
1237
+ status (google.rpc.status_pb2.Status):
1238
+ The status of the stream.
1239
+ continuation_tokens (MutableSequence[google.cloud.bigtable_v2.types.StreamContinuationToken]):
1240
+ If non-empty, contains the information needed
1241
+ to resume reading their associated partitions.
1242
+ new_partitions (MutableSequence[google.cloud.bigtable_v2.types.StreamPartition]):
1243
+ If non-empty, contains the new partitions to start reading
1244
+ from, which are related to but not necessarily identical to
1245
+ the partitions for the above ``continuation_tokens``.
1246
+ """
1247
+
1248
+ status: status_pb2.Status = proto.Field(
1249
+ proto.MESSAGE,
1250
+ number=1,
1251
+ message=status_pb2.Status,
1252
+ )
1253
+ continuation_tokens: MutableSequence[
1254
+ data.StreamContinuationToken
1255
+ ] = proto.RepeatedField(
1256
+ proto.MESSAGE,
1257
+ number=2,
1258
+ message=data.StreamContinuationToken,
1259
+ )
1260
+ new_partitions: MutableSequence[data.StreamPartition] = proto.RepeatedField(
1261
+ proto.MESSAGE,
1262
+ number=3,
1263
+ message=data.StreamPartition,
1264
+ )
1265
+
1266
+ data_change: DataChange = proto.Field(
1267
+ proto.MESSAGE,
1268
+ number=1,
1269
+ oneof="stream_record",
1270
+ message=DataChange,
1271
+ )
1272
+ heartbeat: Heartbeat = proto.Field(
1273
+ proto.MESSAGE,
1274
+ number=2,
1275
+ oneof="stream_record",
1276
+ message=Heartbeat,
1277
+ )
1278
+ close_stream: CloseStream = proto.Field(
1279
+ proto.MESSAGE,
1280
+ number=3,
1281
+ oneof="stream_record",
1282
+ message=CloseStream,
1283
+ )
1284
+
1285
+
1286
+ class ExecuteQueryRequest(proto.Message):
1287
+ r"""Request message for Bigtable.ExecuteQuery
1288
+
1289
+ .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
1290
+
1291
+ Attributes:
1292
+ instance_name (str):
1293
+ Required. The unique name of the instance against which the
1294
+ query should be executed. Values are of the form
1295
+ ``projects/<project>/instances/<instance>``
1296
+ app_profile_id (str):
1297
+ Optional. This value specifies routing for replication. If
1298
+ not specified, the ``default`` application profile will be
1299
+ used.
1300
+ query (str):
1301
+ Required. The query string.
1302
+
1303
+ Exactly one of ``query`` and ``prepared_query`` is required.
1304
+ Setting both or neither is an ``INVALID_ARGUMENT``.
1305
+ prepared_query (bytes):
1306
+ A prepared query that was returned from
1307
+ ``PrepareQueryResponse``.
1308
+
1309
+ Exactly one of ``query`` and ``prepared_query`` is required.
1310
+ Setting both or neither is an ``INVALID_ARGUMENT``.
1311
+
1312
+ Setting this field also places restrictions on several other
1313
+ fields:
1314
+
1315
+ - ``data_format`` must be empty.
1316
+ - ``validate_only`` must be false.
1317
+ - ``params`` must match the ``param_types`` set in the
1318
+ ``PrepareQueryRequest``.
1319
+ proto_format (google.cloud.bigtable_v2.types.ProtoFormat):
1320
+ Protocol buffer format as described by
1321
+ ProtoSchema and ProtoRows messages.
1322
+
1323
+ This field is a member of `oneof`_ ``data_format``.
1324
+ resume_token (bytes):
1325
+ Optional. If this request is resuming a previously
1326
+ interrupted query execution, ``resume_token`` should be
1327
+ copied from the last PartialResultSet yielded before the
1328
+ interruption. Doing this enables the query execution to
1329
+ resume where the last one left off. The rest of the request
1330
+ parameters must exactly match the request that yielded this
1331
+ token. Otherwise the request will fail.
1332
+ params (MutableMapping[str, google.cloud.bigtable_v2.types.Value]):
1333
+ Required. params contains string type keys and Bigtable type
1334
+ values that bind to placeholders in the query string. In
1335
+ query string, a parameter placeholder consists of the ``@``
1336
+ character followed by the parameter name (for example,
1337
+ ``@firstName``) in the query string.
1338
+
1339
+ For example, if
1340
+ ``params["firstName"] = bytes_value: "foo" type {bytes_type {}}``
1341
+ then ``@firstName`` will be replaced with googlesql bytes
1342
+ value "foo" in the query string during query evaluation.
1343
+
1344
+ If ``Value.kind`` is not set, the value is treated as a NULL
1345
+ value of the given type. For example, if
1346
+ ``params["firstName"] = type {string_type {}}`` then
1347
+ ``@firstName`` will be replaced with googlesql null string.
1348
+
1349
+ If ``query`` is set, any empty ``Value.type`` in the map
1350
+ will be rejected with ``INVALID_ARGUMENT``.
1351
+
1352
+ If ``prepared_query`` is set, any empty ``Value.type`` in
1353
+ the map will be inferred from the ``param_types`` in the
1354
+ ``PrepareQueryRequest``. Any non-empty ``Value.type`` must
1355
+ match the corresponding ``param_types`` entry, or be
1356
+ rejected with ``INVALID_ARGUMENT``.
1357
+ """
1358
+
1359
+ instance_name: str = proto.Field(
1360
+ proto.STRING,
1361
+ number=1,
1362
+ )
1363
+ app_profile_id: str = proto.Field(
1364
+ proto.STRING,
1365
+ number=2,
1366
+ )
1367
+ query: str = proto.Field(
1368
+ proto.STRING,
1369
+ number=3,
1370
+ )
1371
+ prepared_query: bytes = proto.Field(
1372
+ proto.BYTES,
1373
+ number=9,
1374
+ )
1375
+ proto_format: data.ProtoFormat = proto.Field(
1376
+ proto.MESSAGE,
1377
+ number=4,
1378
+ oneof="data_format",
1379
+ message=data.ProtoFormat,
1380
+ )
1381
+ resume_token: bytes = proto.Field(
1382
+ proto.BYTES,
1383
+ number=8,
1384
+ )
1385
+ params: MutableMapping[str, data.Value] = proto.MapField(
1386
+ proto.STRING,
1387
+ proto.MESSAGE,
1388
+ number=7,
1389
+ message=data.Value,
1390
+ )
1391
+
1392
+
1393
+ class ExecuteQueryResponse(proto.Message):
1394
+ r"""Response message for Bigtable.ExecuteQuery
1395
+
1396
+ This message has `oneof`_ fields (mutually exclusive fields).
1397
+ For each oneof, at most one member field can be set at the same time.
1398
+ Setting any member of the oneof automatically clears all other
1399
+ members.
1400
+
1401
+ .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
1402
+
1403
+ Attributes:
1404
+ metadata (google.cloud.bigtable_v2.types.ResultSetMetadata):
1405
+ Structure of rows in this response stream.
1406
+ The first (and only the first) response streamed
1407
+ from the server will be of this type.
1408
+
1409
+ This field is a member of `oneof`_ ``response``.
1410
+ results (google.cloud.bigtable_v2.types.PartialResultSet):
1411
+ A partial result set with row data
1412
+ potentially including additional instructions on
1413
+ how recent past and future partial responses
1414
+ should be interpreted.
1415
+
1416
+ This field is a member of `oneof`_ ``response``.
1417
+ """
1418
+
1419
+ metadata: data.ResultSetMetadata = proto.Field(
1420
+ proto.MESSAGE,
1421
+ number=1,
1422
+ oneof="response",
1423
+ message=data.ResultSetMetadata,
1424
+ )
1425
+ results: data.PartialResultSet = proto.Field(
1426
+ proto.MESSAGE,
1427
+ number=2,
1428
+ oneof="response",
1429
+ message=data.PartialResultSet,
1430
+ )
1431
+
1432
+
1433
+ class PrepareQueryRequest(proto.Message):
1434
+ r"""Request message for Bigtable.PrepareQuery
1435
+
1436
+ .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
1437
+
1438
+ Attributes:
1439
+ instance_name (str):
1440
+ Required. The unique name of the instance against which the
1441
+ query should be executed. Values are of the form
1442
+ ``projects/<project>/instances/<instance>``
1443
+ app_profile_id (str):
1444
+ Optional. This value specifies routing for preparing the
1445
+ query. Note that this ``app_profile_id`` is only used for
1446
+ preparing the query. The actual query execution will use the
1447
+ app profile specified in the ``ExecuteQueryRequest``. If not
1448
+ specified, the ``default`` application profile will be used.
1449
+ query (str):
1450
+ Required. The query string.
1451
+ proto_format (google.cloud.bigtable_v2.types.ProtoFormat):
1452
+ Protocol buffer format as described by
1453
+ ProtoSchema and ProtoRows messages.
1454
+
1455
+ This field is a member of `oneof`_ ``data_format``.
1456
+ param_types (MutableMapping[str, google.cloud.bigtable_v2.types.Type]):
1457
+ Required. ``param_types`` is a map of parameter identifier
1458
+ strings to their ``Type``\ s.
1459
+
1460
+ In query string, a parameter placeholder consists of the
1461
+ ``@`` character followed by the parameter name (for example,
1462
+ ``@firstName``) in the query string.
1463
+
1464
+ For example, if param_types["firstName"] = Bytes then
1465
+ @firstName will be a query parameter of type Bytes. The
1466
+ specific ``Value`` to be used for the query execution must
1467
+ be sent in ``ExecuteQueryRequest`` in the ``params`` map.
1468
+ """
1469
+
1470
+ instance_name: str = proto.Field(
1471
+ proto.STRING,
1472
+ number=1,
1473
+ )
1474
+ app_profile_id: str = proto.Field(
1475
+ proto.STRING,
1476
+ number=2,
1477
+ )
1478
+ query: str = proto.Field(
1479
+ proto.STRING,
1480
+ number=3,
1481
+ )
1482
+ proto_format: data.ProtoFormat = proto.Field(
1483
+ proto.MESSAGE,
1484
+ number=4,
1485
+ oneof="data_format",
1486
+ message=data.ProtoFormat,
1487
+ )
1488
+ param_types: MutableMapping[str, types.Type] = proto.MapField(
1489
+ proto.STRING,
1490
+ proto.MESSAGE,
1491
+ number=6,
1492
+ message=types.Type,
1493
+ )
1494
+
1495
+
1496
+ class PrepareQueryResponse(proto.Message):
1497
+ r"""Response message for Bigtable.PrepareQueryResponse
1498
+
1499
+ Attributes:
1500
+ metadata (google.cloud.bigtable_v2.types.ResultSetMetadata):
1501
+ Structure of rows in the response stream of
1502
+ ``ExecuteQueryResponse`` for the returned
1503
+ ``prepared_query``.
1504
+ prepared_query (bytes):
1505
+ A serialized prepared query. Clients should treat this as an
1506
+ opaque blob of bytes to send in ``ExecuteQueryRequest``.
1507
+ valid_until (google.protobuf.timestamp_pb2.Timestamp):
1508
+ The time at which the prepared query token
1509
+ becomes invalid. A token may become invalid
1510
+ early due to changes in the data being read, but
1511
+ it provides a guideline to refresh query plans
1512
+ asynchronously.
1513
+ """
1514
+
1515
+ metadata: data.ResultSetMetadata = proto.Field(
1516
+ proto.MESSAGE,
1517
+ number=1,
1518
+ message=data.ResultSetMetadata,
1519
+ )
1520
+ prepared_query: bytes = proto.Field(
1521
+ proto.BYTES,
1522
+ number=2,
1523
+ )
1524
+ valid_until: timestamp_pb2.Timestamp = proto.Field(
1525
+ proto.MESSAGE,
1526
+ number=3,
1527
+ message=timestamp_pb2.Timestamp,
1528
+ )
1529
+
1530
+
1531
+ __all__ = tuple(sorted(__protobuf__.manifest))