xref: /aosp_15_r20/external/googleapis/google/bigtable/v2/bigtable.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1*d5c09012SAndroid Build Coastguard Worker// Copyright 2023 Google LLC
2*d5c09012SAndroid Build Coastguard Worker//
3*d5c09012SAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License");
4*d5c09012SAndroid Build Coastguard Worker// you may not use this file except in compliance with the License.
5*d5c09012SAndroid Build Coastguard Worker// You may obtain a copy of the License at
6*d5c09012SAndroid Build Coastguard Worker//
7*d5c09012SAndroid Build Coastguard Worker//     http://www.apache.org/licenses/LICENSE-2.0
8*d5c09012SAndroid Build Coastguard Worker//
9*d5c09012SAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software
10*d5c09012SAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS,
11*d5c09012SAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*d5c09012SAndroid Build Coastguard Worker// See the License for the specific language governing permissions and
13*d5c09012SAndroid Build Coastguard Worker// limitations under the License.
14*d5c09012SAndroid Build Coastguard Worker
15*d5c09012SAndroid Build Coastguard Workersyntax = "proto3";
16*d5c09012SAndroid Build Coastguard Worker
17*d5c09012SAndroid Build Coastguard Workerpackage google.bigtable.v2;
18*d5c09012SAndroid Build Coastguard Worker
19*d5c09012SAndroid Build Coastguard Workerimport "google/api/annotations.proto";
20*d5c09012SAndroid Build Coastguard Workerimport "google/api/client.proto";
21*d5c09012SAndroid Build Coastguard Workerimport "google/api/field_behavior.proto";
22*d5c09012SAndroid Build Coastguard Workerimport "google/api/resource.proto";
23*d5c09012SAndroid Build Coastguard Workerimport "google/api/routing.proto";
24*d5c09012SAndroid Build Coastguard Workerimport "google/bigtable/v2/data.proto";
25*d5c09012SAndroid Build Coastguard Workerimport "google/bigtable/v2/request_stats.proto";
26*d5c09012SAndroid Build Coastguard Workerimport "google/protobuf/duration.proto";
27*d5c09012SAndroid Build Coastguard Workerimport "google/protobuf/timestamp.proto";
28*d5c09012SAndroid Build Coastguard Workerimport "google/protobuf/wrappers.proto";
29*d5c09012SAndroid Build Coastguard Workerimport "google/rpc/status.proto";
30*d5c09012SAndroid Build Coastguard Worker
31*d5c09012SAndroid Build Coastguard Workeroption csharp_namespace = "Google.Cloud.Bigtable.V2";
32*d5c09012SAndroid Build Coastguard Workeroption go_package = "google.golang.org/genproto/googleapis/bigtable/v2;bigtable";
33*d5c09012SAndroid Build Coastguard Workeroption java_multiple_files = true;
34*d5c09012SAndroid Build Coastguard Workeroption java_outer_classname = "BigtableProto";
35*d5c09012SAndroid Build Coastguard Workeroption java_package = "com.google.bigtable.v2";
36*d5c09012SAndroid Build Coastguard Workeroption php_namespace = "Google\\Cloud\\Bigtable\\V2";
37*d5c09012SAndroid Build Coastguard Workeroption ruby_package = "Google::Cloud::Bigtable::V2";
38*d5c09012SAndroid Build Coastguard Workeroption (google.api.resource_definition) = {
39*d5c09012SAndroid Build Coastguard Worker  type: "bigtableadmin.googleapis.com/Instance"
40*d5c09012SAndroid Build Coastguard Worker  pattern: "projects/{project}/instances/{instance}"
41*d5c09012SAndroid Build Coastguard Worker};
42*d5c09012SAndroid Build Coastguard Workeroption (google.api.resource_definition) = {
43*d5c09012SAndroid Build Coastguard Worker  type: "bigtableadmin.googleapis.com/Table"
44*d5c09012SAndroid Build Coastguard Worker  pattern: "projects/{project}/instances/{instance}/tables/{table}"
45*d5c09012SAndroid Build Coastguard Worker};
46*d5c09012SAndroid Build Coastguard Workeroption (google.api.resource_definition) = {
47*d5c09012SAndroid Build Coastguard Worker  type: "bigtableadmin.googleapis.com/AuthorizedView"
48*d5c09012SAndroid Build Coastguard Worker  pattern: "projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}"
49*d5c09012SAndroid Build Coastguard Worker};
50*d5c09012SAndroid Build Coastguard Worker
51*d5c09012SAndroid Build Coastguard Worker// Service for reading from and writing to existing Bigtable tables.
52*d5c09012SAndroid Build Coastguard Workerservice Bigtable {
53*d5c09012SAndroid Build Coastguard Worker  option (google.api.default_host) = "bigtable.googleapis.com";
54*d5c09012SAndroid Build Coastguard Worker  option (google.api.oauth_scopes) =
55*d5c09012SAndroid Build Coastguard Worker      "https://www.googleapis.com/auth/bigtable.data,"
56*d5c09012SAndroid Build Coastguard Worker      "https://www.googleapis.com/auth/bigtable.data.readonly,"
57*d5c09012SAndroid Build Coastguard Worker      "https://www.googleapis.com/auth/cloud-bigtable.data,"
58*d5c09012SAndroid Build Coastguard Worker      "https://www.googleapis.com/auth/cloud-bigtable.data.readonly,"
59*d5c09012SAndroid Build Coastguard Worker      "https://www.googleapis.com/auth/cloud-platform,"
60*d5c09012SAndroid Build Coastguard Worker      "https://www.googleapis.com/auth/cloud-platform.read-only";
61*d5c09012SAndroid Build Coastguard Worker
62*d5c09012SAndroid Build Coastguard Worker  // Streams back the contents of all requested rows in key order, optionally
63*d5c09012SAndroid Build Coastguard Worker  // applying the same Reader filter to each. Depending on their size,
64*d5c09012SAndroid Build Coastguard Worker  // rows and cells may be broken up across multiple responses, but
65*d5c09012SAndroid Build Coastguard Worker  // atomicity of each row will still be preserved. See the
66*d5c09012SAndroid Build Coastguard Worker  // ReadRowsResponse documentation for details.
67*d5c09012SAndroid Build Coastguard Worker  rpc ReadRows(ReadRowsRequest) returns (stream ReadRowsResponse) {
68*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
69*d5c09012SAndroid Build Coastguard Worker      post: "/v2/{table_name=projects/*/instances/*/tables/*}:readRows"
70*d5c09012SAndroid Build Coastguard Worker      body: "*"
71*d5c09012SAndroid Build Coastguard Worker      additional_bindings {
72*d5c09012SAndroid Build Coastguard Worker        post: "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:readRows"
73*d5c09012SAndroid Build Coastguard Worker        body: "*"
74*d5c09012SAndroid Build Coastguard Worker      }
75*d5c09012SAndroid Build Coastguard Worker    };
76*d5c09012SAndroid Build Coastguard Worker    option (google.api.routing) = {
77*d5c09012SAndroid Build Coastguard Worker      routing_parameters {
78*d5c09012SAndroid Build Coastguard Worker        field: "table_name"
79*d5c09012SAndroid Build Coastguard Worker        path_template: "{table_name=projects/*/instances/*/tables/*}"
80*d5c09012SAndroid Build Coastguard Worker      }
81*d5c09012SAndroid Build Coastguard Worker      routing_parameters { field: "app_profile_id" }
82*d5c09012SAndroid Build Coastguard Worker      routing_parameters {
83*d5c09012SAndroid Build Coastguard Worker        field: "authorized_view_name"
84*d5c09012SAndroid Build Coastguard Worker        path_template: "{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}"
85*d5c09012SAndroid Build Coastguard Worker      }
86*d5c09012SAndroid Build Coastguard Worker    };
87*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "table_name";
88*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "table_name,app_profile_id";
89*d5c09012SAndroid Build Coastguard Worker  }
90*d5c09012SAndroid Build Coastguard Worker
91*d5c09012SAndroid Build Coastguard Worker  // Returns a sample of row keys in the table. The returned row keys will
92*d5c09012SAndroid Build Coastguard Worker  // delimit contiguous sections of the table of approximately equal size,
93*d5c09012SAndroid Build Coastguard Worker  // which can be used to break up the data for distributed tasks like
94*d5c09012SAndroid Build Coastguard Worker  // mapreduces.
95*d5c09012SAndroid Build Coastguard Worker  rpc SampleRowKeys(SampleRowKeysRequest)
96*d5c09012SAndroid Build Coastguard Worker      returns (stream SampleRowKeysResponse) {
97*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
98*d5c09012SAndroid Build Coastguard Worker      get: "/v2/{table_name=projects/*/instances/*/tables/*}:sampleRowKeys"
99*d5c09012SAndroid Build Coastguard Worker      additional_bindings {
100*d5c09012SAndroid Build Coastguard Worker        get: "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:sampleRowKeys"
101*d5c09012SAndroid Build Coastguard Worker      }
102*d5c09012SAndroid Build Coastguard Worker    };
103*d5c09012SAndroid Build Coastguard Worker    option (google.api.routing) = {
104*d5c09012SAndroid Build Coastguard Worker      routing_parameters {
105*d5c09012SAndroid Build Coastguard Worker        field: "table_name"
106*d5c09012SAndroid Build Coastguard Worker        path_template: "{table_name=projects/*/instances/*/tables/*}"
107*d5c09012SAndroid Build Coastguard Worker      }
108*d5c09012SAndroid Build Coastguard Worker      routing_parameters { field: "app_profile_id" }
109*d5c09012SAndroid Build Coastguard Worker      routing_parameters {
110*d5c09012SAndroid Build Coastguard Worker        field: "authorized_view_name"
111*d5c09012SAndroid Build Coastguard Worker        path_template: "{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}"
112*d5c09012SAndroid Build Coastguard Worker      }
113*d5c09012SAndroid Build Coastguard Worker    };
114*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "table_name";
115*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "table_name,app_profile_id";
116*d5c09012SAndroid Build Coastguard Worker  }
117*d5c09012SAndroid Build Coastguard Worker
118*d5c09012SAndroid Build Coastguard Worker  // Mutates a row atomically. Cells already present in the row are left
119*d5c09012SAndroid Build Coastguard Worker  // unchanged unless explicitly changed by `mutation`.
120*d5c09012SAndroid Build Coastguard Worker  rpc MutateRow(MutateRowRequest) returns (MutateRowResponse) {
121*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
122*d5c09012SAndroid Build Coastguard Worker      post: "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRow"
123*d5c09012SAndroid Build Coastguard Worker      body: "*"
124*d5c09012SAndroid Build Coastguard Worker      additional_bindings {
125*d5c09012SAndroid Build Coastguard Worker        post: "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:mutateRow"
126*d5c09012SAndroid Build Coastguard Worker        body: "*"
127*d5c09012SAndroid Build Coastguard Worker      }
128*d5c09012SAndroid Build Coastguard Worker    };
129*d5c09012SAndroid Build Coastguard Worker    option (google.api.routing) = {
130*d5c09012SAndroid Build Coastguard Worker      routing_parameters {
131*d5c09012SAndroid Build Coastguard Worker        field: "table_name"
132*d5c09012SAndroid Build Coastguard Worker        path_template: "{table_name=projects/*/instances/*/tables/*}"
133*d5c09012SAndroid Build Coastguard Worker      }
134*d5c09012SAndroid Build Coastguard Worker      routing_parameters { field: "app_profile_id" }
135*d5c09012SAndroid Build Coastguard Worker      routing_parameters {
136*d5c09012SAndroid Build Coastguard Worker        field: "authorized_view_name"
137*d5c09012SAndroid Build Coastguard Worker        path_template: "{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}"
138*d5c09012SAndroid Build Coastguard Worker      }
139*d5c09012SAndroid Build Coastguard Worker    };
140*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "table_name,row_key,mutations";
141*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) =
142*d5c09012SAndroid Build Coastguard Worker        "table_name,row_key,mutations,app_profile_id";
143*d5c09012SAndroid Build Coastguard Worker  }
144*d5c09012SAndroid Build Coastguard Worker
145*d5c09012SAndroid Build Coastguard Worker  // Mutates multiple rows in a batch. Each individual row is mutated
146*d5c09012SAndroid Build Coastguard Worker  // atomically as in MutateRow, but the entire batch is not executed
147*d5c09012SAndroid Build Coastguard Worker  // atomically.
148*d5c09012SAndroid Build Coastguard Worker  rpc MutateRows(MutateRowsRequest) returns (stream MutateRowsResponse) {
149*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
150*d5c09012SAndroid Build Coastguard Worker      post: "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRows"
151*d5c09012SAndroid Build Coastguard Worker      body: "*"
152*d5c09012SAndroid Build Coastguard Worker      additional_bindings {
153*d5c09012SAndroid Build Coastguard Worker        post: "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:mutateRows"
154*d5c09012SAndroid Build Coastguard Worker        body: "*"
155*d5c09012SAndroid Build Coastguard Worker      }
156*d5c09012SAndroid Build Coastguard Worker    };
157*d5c09012SAndroid Build Coastguard Worker    option (google.api.routing) = {
158*d5c09012SAndroid Build Coastguard Worker      routing_parameters {
159*d5c09012SAndroid Build Coastguard Worker        field: "table_name"
160*d5c09012SAndroid Build Coastguard Worker        path_template: "{table_name=projects/*/instances/*/tables/*}"
161*d5c09012SAndroid Build Coastguard Worker      }
162*d5c09012SAndroid Build Coastguard Worker      routing_parameters { field: "app_profile_id" }
163*d5c09012SAndroid Build Coastguard Worker      routing_parameters {
164*d5c09012SAndroid Build Coastguard Worker        field: "authorized_view_name"
165*d5c09012SAndroid Build Coastguard Worker        path_template: "{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}"
166*d5c09012SAndroid Build Coastguard Worker      }
167*d5c09012SAndroid Build Coastguard Worker    };
168*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "table_name,entries";
169*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "table_name,entries,app_profile_id";
170*d5c09012SAndroid Build Coastguard Worker  }
171*d5c09012SAndroid Build Coastguard Worker
172*d5c09012SAndroid Build Coastguard Worker  // Mutates a row atomically based on the output of a predicate Reader filter.
173*d5c09012SAndroid Build Coastguard Worker  rpc CheckAndMutateRow(CheckAndMutateRowRequest)
174*d5c09012SAndroid Build Coastguard Worker      returns (CheckAndMutateRowResponse) {
175*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
176*d5c09012SAndroid Build Coastguard Worker      post: "/v2/{table_name=projects/*/instances/*/tables/*}:checkAndMutateRow"
177*d5c09012SAndroid Build Coastguard Worker      body: "*"
178*d5c09012SAndroid Build Coastguard Worker      additional_bindings {
179*d5c09012SAndroid Build Coastguard Worker        post: "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:checkAndMutateRow"
180*d5c09012SAndroid Build Coastguard Worker        body: "*"
181*d5c09012SAndroid Build Coastguard Worker      }
182*d5c09012SAndroid Build Coastguard Worker    };
183*d5c09012SAndroid Build Coastguard Worker    option (google.api.routing) = {
184*d5c09012SAndroid Build Coastguard Worker      routing_parameters {
185*d5c09012SAndroid Build Coastguard Worker        field: "table_name"
186*d5c09012SAndroid Build Coastguard Worker        path_template: "{table_name=projects/*/instances/*/tables/*}"
187*d5c09012SAndroid Build Coastguard Worker      }
188*d5c09012SAndroid Build Coastguard Worker      routing_parameters { field: "app_profile_id" }
189*d5c09012SAndroid Build Coastguard Worker      routing_parameters {
190*d5c09012SAndroid Build Coastguard Worker        field: "authorized_view_name"
191*d5c09012SAndroid Build Coastguard Worker        path_template: "{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}"
192*d5c09012SAndroid Build Coastguard Worker      }
193*d5c09012SAndroid Build Coastguard Worker    };
194*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) =
195*d5c09012SAndroid Build Coastguard Worker        "table_name,row_key,predicate_filter,true_mutations,false_mutations";
196*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) =
197*d5c09012SAndroid Build Coastguard Worker        "table_name,row_key,predicate_filter,true_mutations,false_mutations,app_profile_id";
198*d5c09012SAndroid Build Coastguard Worker  }
199*d5c09012SAndroid Build Coastguard Worker
200*d5c09012SAndroid Build Coastguard Worker  // Warm up associated instance metadata for this connection.
201*d5c09012SAndroid Build Coastguard Worker  // This call is not required but may be useful for connection keep-alive.
202*d5c09012SAndroid Build Coastguard Worker  rpc PingAndWarm(PingAndWarmRequest) returns (PingAndWarmResponse) {
203*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
204*d5c09012SAndroid Build Coastguard Worker      post: "/v2/{name=projects/*/instances/*}:ping"
205*d5c09012SAndroid Build Coastguard Worker      body: "*"
206*d5c09012SAndroid Build Coastguard Worker    };
207*d5c09012SAndroid Build Coastguard Worker    option (google.api.routing) = {
208*d5c09012SAndroid Build Coastguard Worker      routing_parameters {
209*d5c09012SAndroid Build Coastguard Worker        field: "name"
210*d5c09012SAndroid Build Coastguard Worker        path_template: "{name=projects/*/instances/*}"
211*d5c09012SAndroid Build Coastguard Worker      }
212*d5c09012SAndroid Build Coastguard Worker      routing_parameters { field: "app_profile_id" }
213*d5c09012SAndroid Build Coastguard Worker    };
214*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "name";
215*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "name,app_profile_id";
216*d5c09012SAndroid Build Coastguard Worker  }
217*d5c09012SAndroid Build Coastguard Worker
218*d5c09012SAndroid Build Coastguard Worker  // Modifies a row atomically on the server. The method reads the latest
219*d5c09012SAndroid Build Coastguard Worker  // existing timestamp and value from the specified columns and writes a new
220*d5c09012SAndroid Build Coastguard Worker  // entry based on pre-defined read/modify/write rules. The new value for the
221*d5c09012SAndroid Build Coastguard Worker  // timestamp is the greater of the existing timestamp or the current server
222*d5c09012SAndroid Build Coastguard Worker  // time. The method returns the new contents of all modified cells.
223*d5c09012SAndroid Build Coastguard Worker  rpc ReadModifyWriteRow(ReadModifyWriteRowRequest)
224*d5c09012SAndroid Build Coastguard Worker      returns (ReadModifyWriteRowResponse) {
225*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
226*d5c09012SAndroid Build Coastguard Worker      post: "/v2/{table_name=projects/*/instances/*/tables/*}:readModifyWriteRow"
227*d5c09012SAndroid Build Coastguard Worker      body: "*"
228*d5c09012SAndroid Build Coastguard Worker      additional_bindings {
229*d5c09012SAndroid Build Coastguard Worker        post: "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:readModifyWriteRow"
230*d5c09012SAndroid Build Coastguard Worker        body: "*"
231*d5c09012SAndroid Build Coastguard Worker      }
232*d5c09012SAndroid Build Coastguard Worker    };
233*d5c09012SAndroid Build Coastguard Worker    option (google.api.routing) = {
234*d5c09012SAndroid Build Coastguard Worker      routing_parameters {
235*d5c09012SAndroid Build Coastguard Worker        field: "table_name"
236*d5c09012SAndroid Build Coastguard Worker        path_template: "{table_name=projects/*/instances/*/tables/*}"
237*d5c09012SAndroid Build Coastguard Worker      }
238*d5c09012SAndroid Build Coastguard Worker      routing_parameters { field: "app_profile_id" }
239*d5c09012SAndroid Build Coastguard Worker      routing_parameters {
240*d5c09012SAndroid Build Coastguard Worker        field: "authorized_view_name"
241*d5c09012SAndroid Build Coastguard Worker        path_template: "{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}"
242*d5c09012SAndroid Build Coastguard Worker      }
243*d5c09012SAndroid Build Coastguard Worker    };
244*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "table_name,row_key,rules";
245*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) =
246*d5c09012SAndroid Build Coastguard Worker        "table_name,row_key,rules,app_profile_id";
247*d5c09012SAndroid Build Coastguard Worker  }
248*d5c09012SAndroid Build Coastguard Worker
249*d5c09012SAndroid Build Coastguard Worker  // NOTE: This API is intended to be used by Apache Beam BigtableIO.
250*d5c09012SAndroid Build Coastguard Worker  // Returns the current list of partitions that make up the table's
251*d5c09012SAndroid Build Coastguard Worker  // change stream. The union of partitions will cover the entire keyspace.
252*d5c09012SAndroid Build Coastguard Worker  // Partitions can be read with `ReadChangeStream`.
253*d5c09012SAndroid Build Coastguard Worker  rpc GenerateInitialChangeStreamPartitions(
254*d5c09012SAndroid Build Coastguard Worker      GenerateInitialChangeStreamPartitionsRequest)
255*d5c09012SAndroid Build Coastguard Worker      returns (stream GenerateInitialChangeStreamPartitionsResponse) {
256*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
257*d5c09012SAndroid Build Coastguard Worker      post: "/v2/{table_name=projects/*/instances/*/tables/*}:generateInitialChangeStreamPartitions"
258*d5c09012SAndroid Build Coastguard Worker      body: "*"
259*d5c09012SAndroid Build Coastguard Worker    };
260*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "table_name";
261*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "table_name,app_profile_id";
262*d5c09012SAndroid Build Coastguard Worker  }
263*d5c09012SAndroid Build Coastguard Worker
264*d5c09012SAndroid Build Coastguard Worker  // NOTE: This API is intended to be used by Apache Beam BigtableIO.
265*d5c09012SAndroid Build Coastguard Worker  // Reads changes from a table's change stream. Changes will
266*d5c09012SAndroid Build Coastguard Worker  // reflect both user-initiated mutations and mutations that are caused by
267*d5c09012SAndroid Build Coastguard Worker  // garbage collection.
268*d5c09012SAndroid Build Coastguard Worker  rpc ReadChangeStream(ReadChangeStreamRequest)
269*d5c09012SAndroid Build Coastguard Worker      returns (stream ReadChangeStreamResponse) {
270*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
271*d5c09012SAndroid Build Coastguard Worker      post: "/v2/{table_name=projects/*/instances/*/tables/*}:readChangeStream"
272*d5c09012SAndroid Build Coastguard Worker      body: "*"
273*d5c09012SAndroid Build Coastguard Worker    };
274*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "table_name";
275*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "table_name,app_profile_id";
276*d5c09012SAndroid Build Coastguard Worker  }
277*d5c09012SAndroid Build Coastguard Worker}
278*d5c09012SAndroid Build Coastguard Worker
279*d5c09012SAndroid Build Coastguard Worker// Request message for Bigtable.ReadRows.
280*d5c09012SAndroid Build Coastguard Workermessage ReadRowsRequest {
281*d5c09012SAndroid Build Coastguard Worker  // The desired view into RequestStats that should be returned in the response.
282*d5c09012SAndroid Build Coastguard Worker  //
283*d5c09012SAndroid Build Coastguard Worker  // See also: RequestStats message.
284*d5c09012SAndroid Build Coastguard Worker  enum RequestStatsView {
285*d5c09012SAndroid Build Coastguard Worker    // The default / unset value. The API will default to the NONE option below.
286*d5c09012SAndroid Build Coastguard Worker    REQUEST_STATS_VIEW_UNSPECIFIED = 0;
287*d5c09012SAndroid Build Coastguard Worker
288*d5c09012SAndroid Build Coastguard Worker    // Do not include any RequestStats in the response. This will leave the
289*d5c09012SAndroid Build Coastguard Worker    // RequestStats embedded message unset in the response.
290*d5c09012SAndroid Build Coastguard Worker    REQUEST_STATS_NONE = 1;
291*d5c09012SAndroid Build Coastguard Worker
292*d5c09012SAndroid Build Coastguard Worker    // Include the full set of available RequestStats in the response,
293*d5c09012SAndroid Build Coastguard Worker    // applicable to this read.
294*d5c09012SAndroid Build Coastguard Worker    REQUEST_STATS_FULL = 2;
295*d5c09012SAndroid Build Coastguard Worker  }
296*d5c09012SAndroid Build Coastguard Worker
297*d5c09012SAndroid Build Coastguard Worker  // Optional. The unique name of the table from which to read.
298*d5c09012SAndroid Build Coastguard Worker  //
299*d5c09012SAndroid Build Coastguard Worker  // Values are of the form
300*d5c09012SAndroid Build Coastguard Worker  // `projects/<project>/instances/<instance>/tables/<table>`.
301*d5c09012SAndroid Build Coastguard Worker  string table_name = 1 [
302*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = OPTIONAL,
303*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
304*d5c09012SAndroid Build Coastguard Worker      type: "bigtableadmin.googleapis.com/Table"
305*d5c09012SAndroid Build Coastguard Worker    }
306*d5c09012SAndroid Build Coastguard Worker  ];
307*d5c09012SAndroid Build Coastguard Worker
308*d5c09012SAndroid Build Coastguard Worker  // Optional. The unique name of the AuthorizedView from which to read.
309*d5c09012SAndroid Build Coastguard Worker  //
310*d5c09012SAndroid Build Coastguard Worker  // Values are of the form
311*d5c09012SAndroid Build Coastguard Worker  // `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
312*d5c09012SAndroid Build Coastguard Worker  string authorized_view_name = 9 [
313*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = OPTIONAL,
314*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
315*d5c09012SAndroid Build Coastguard Worker      type: "bigtableadmin.googleapis.com/AuthorizedView"
316*d5c09012SAndroid Build Coastguard Worker    }
317*d5c09012SAndroid Build Coastguard Worker  ];
318*d5c09012SAndroid Build Coastguard Worker
319*d5c09012SAndroid Build Coastguard Worker  // This value specifies routing for replication. If not specified, the
320*d5c09012SAndroid Build Coastguard Worker  // "default" application profile will be used.
321*d5c09012SAndroid Build Coastguard Worker  string app_profile_id = 5;
322*d5c09012SAndroid Build Coastguard Worker
323*d5c09012SAndroid Build Coastguard Worker  // The row keys and/or ranges to read sequentially. If not specified, reads
324*d5c09012SAndroid Build Coastguard Worker  // from all rows.
325*d5c09012SAndroid Build Coastguard Worker  RowSet rows = 2;
326*d5c09012SAndroid Build Coastguard Worker
327*d5c09012SAndroid Build Coastguard Worker  // The filter to apply to the contents of the specified row(s). If unset,
328*d5c09012SAndroid Build Coastguard Worker  // reads the entirety of each row.
329*d5c09012SAndroid Build Coastguard Worker  RowFilter filter = 3;
330*d5c09012SAndroid Build Coastguard Worker
331*d5c09012SAndroid Build Coastguard Worker  // The read will stop after committing to N rows' worth of results. The
332*d5c09012SAndroid Build Coastguard Worker  // default (zero) is to return all results.
333*d5c09012SAndroid Build Coastguard Worker  int64 rows_limit = 4;
334*d5c09012SAndroid Build Coastguard Worker
335*d5c09012SAndroid Build Coastguard Worker  // The view into RequestStats, as described above.
336*d5c09012SAndroid Build Coastguard Worker  RequestStatsView request_stats_view = 6;
337*d5c09012SAndroid Build Coastguard Worker
338*d5c09012SAndroid Build Coastguard Worker  // Experimental API - Please note that this API is currently experimental
339*d5c09012SAndroid Build Coastguard Worker  // and can change in the future.
340*d5c09012SAndroid Build Coastguard Worker  //
341*d5c09012SAndroid Build Coastguard Worker  // Return rows in lexiographical descending order of the row keys. The row
342*d5c09012SAndroid Build Coastguard Worker  // contents will not be affected by this flag.
343*d5c09012SAndroid Build Coastguard Worker  //
344*d5c09012SAndroid Build Coastguard Worker  // Example result set:
345*d5c09012SAndroid Build Coastguard Worker  //
346*d5c09012SAndroid Build Coastguard Worker  //     [
347*d5c09012SAndroid Build Coastguard Worker  //       {key: "k2", "f:col1": "v1", "f:col2": "v1"},
348*d5c09012SAndroid Build Coastguard Worker  //       {key: "k1", "f:col1": "v2", "f:col2": "v2"}
349*d5c09012SAndroid Build Coastguard Worker  //     ]
350*d5c09012SAndroid Build Coastguard Worker  bool reversed = 7;
351*d5c09012SAndroid Build Coastguard Worker}
352*d5c09012SAndroid Build Coastguard Worker
353*d5c09012SAndroid Build Coastguard Worker// Response message for Bigtable.ReadRows.
354*d5c09012SAndroid Build Coastguard Workermessage ReadRowsResponse {
355*d5c09012SAndroid Build Coastguard Worker  // Specifies a piece of a row's contents returned as part of the read
356*d5c09012SAndroid Build Coastguard Worker  // response stream.
357*d5c09012SAndroid Build Coastguard Worker  message CellChunk {
358*d5c09012SAndroid Build Coastguard Worker    // The row key for this chunk of data.  If the row key is empty,
359*d5c09012SAndroid Build Coastguard Worker    // this CellChunk is a continuation of the same row as the previous
360*d5c09012SAndroid Build Coastguard Worker    // CellChunk in the response stream, even if that CellChunk was in a
361*d5c09012SAndroid Build Coastguard Worker    // previous ReadRowsResponse message.
362*d5c09012SAndroid Build Coastguard Worker    bytes row_key = 1;
363*d5c09012SAndroid Build Coastguard Worker
364*d5c09012SAndroid Build Coastguard Worker    // The column family name for this chunk of data.  If this message
365*d5c09012SAndroid Build Coastguard Worker    // is not present this CellChunk is a continuation of the same column
366*d5c09012SAndroid Build Coastguard Worker    // family as the previous CellChunk.  The empty string can occur as a
367*d5c09012SAndroid Build Coastguard Worker    // column family name in a response so clients must check
368*d5c09012SAndroid Build Coastguard Worker    // explicitly for the presence of this message, not just for
369*d5c09012SAndroid Build Coastguard Worker    // `family_name.value` being non-empty.
370*d5c09012SAndroid Build Coastguard Worker    google.protobuf.StringValue family_name = 2;
371*d5c09012SAndroid Build Coastguard Worker
372*d5c09012SAndroid Build Coastguard Worker    // The column qualifier for this chunk of data.  If this message
373*d5c09012SAndroid Build Coastguard Worker    // is not present, this CellChunk is a continuation of the same column
374*d5c09012SAndroid Build Coastguard Worker    // as the previous CellChunk.  Column qualifiers may be empty so
375*d5c09012SAndroid Build Coastguard Worker    // clients must check for the presence of this message, not just
376*d5c09012SAndroid Build Coastguard Worker    // for `qualifier.value` being non-empty.
377*d5c09012SAndroid Build Coastguard Worker    google.protobuf.BytesValue qualifier = 3;
378*d5c09012SAndroid Build Coastguard Worker
379*d5c09012SAndroid Build Coastguard Worker    // The cell's stored timestamp, which also uniquely identifies it
380*d5c09012SAndroid Build Coastguard Worker    // within its column.  Values are always expressed in
381*d5c09012SAndroid Build Coastguard Worker    // microseconds, but individual tables may set a coarser
382*d5c09012SAndroid Build Coastguard Worker    // granularity to further restrict the allowed values. For
383*d5c09012SAndroid Build Coastguard Worker    // example, a table which specifies millisecond granularity will
384*d5c09012SAndroid Build Coastguard Worker    // only allow values of `timestamp_micros` which are multiples of
385*d5c09012SAndroid Build Coastguard Worker    // 1000.  Timestamps are only set in the first CellChunk per cell
386*d5c09012SAndroid Build Coastguard Worker    // (for cells split into multiple chunks).
387*d5c09012SAndroid Build Coastguard Worker    int64 timestamp_micros = 4;
388*d5c09012SAndroid Build Coastguard Worker
389*d5c09012SAndroid Build Coastguard Worker    // Labels applied to the cell by a
390*d5c09012SAndroid Build Coastguard Worker    // [RowFilter][google.bigtable.v2.RowFilter].  Labels are only set
391*d5c09012SAndroid Build Coastguard Worker    // on the first CellChunk per cell.
392*d5c09012SAndroid Build Coastguard Worker    repeated string labels = 5;
393*d5c09012SAndroid Build Coastguard Worker
394*d5c09012SAndroid Build Coastguard Worker    // The value stored in the cell.  Cell values can be split across
395*d5c09012SAndroid Build Coastguard Worker    // multiple CellChunks.  In that case only the value field will be
396*d5c09012SAndroid Build Coastguard Worker    // set in CellChunks after the first: the timestamp and labels
397*d5c09012SAndroid Build Coastguard Worker    // will only be present in the first CellChunk, even if the first
398*d5c09012SAndroid Build Coastguard Worker    // CellChunk came in a previous ReadRowsResponse.
399*d5c09012SAndroid Build Coastguard Worker    bytes value = 6;
400*d5c09012SAndroid Build Coastguard Worker
401*d5c09012SAndroid Build Coastguard Worker    // If this CellChunk is part of a chunked cell value and this is
402*d5c09012SAndroid Build Coastguard Worker    // not the final chunk of that cell, value_size will be set to the
403*d5c09012SAndroid Build Coastguard Worker    // total length of the cell value.  The client can use this size
404*d5c09012SAndroid Build Coastguard Worker    // to pre-allocate memory to hold the full cell value.
405*d5c09012SAndroid Build Coastguard Worker    int32 value_size = 7;
406*d5c09012SAndroid Build Coastguard Worker
407*d5c09012SAndroid Build Coastguard Worker    // Signals to the client concerning previous CellChunks received.
408*d5c09012SAndroid Build Coastguard Worker    oneof row_status {
409*d5c09012SAndroid Build Coastguard Worker      // Indicates that the client should drop all previous chunks for
410*d5c09012SAndroid Build Coastguard Worker      // `row_key`, as it will be re-read from the beginning.
411*d5c09012SAndroid Build Coastguard Worker      bool reset_row = 8;
412*d5c09012SAndroid Build Coastguard Worker
413*d5c09012SAndroid Build Coastguard Worker      // Indicates that the client can safely process all previous chunks for
414*d5c09012SAndroid Build Coastguard Worker      // `row_key`, as its data has been fully read.
415*d5c09012SAndroid Build Coastguard Worker      bool commit_row = 9;
416*d5c09012SAndroid Build Coastguard Worker    }
417*d5c09012SAndroid Build Coastguard Worker  }
418*d5c09012SAndroid Build Coastguard Worker
419*d5c09012SAndroid Build Coastguard Worker  // A collection of a row's contents as part of the read request.
420*d5c09012SAndroid Build Coastguard Worker  repeated CellChunk chunks = 1;
421*d5c09012SAndroid Build Coastguard Worker
422*d5c09012SAndroid Build Coastguard Worker  // Optionally the server might return the row key of the last row it
423*d5c09012SAndroid Build Coastguard Worker  // has scanned.  The client can use this to construct a more
424*d5c09012SAndroid Build Coastguard Worker  // efficient retry request if needed: any row keys or portions of
425*d5c09012SAndroid Build Coastguard Worker  // ranges less than this row key can be dropped from the request.
426*d5c09012SAndroid Build Coastguard Worker  // This is primarily useful for cases where the server has read a
427*d5c09012SAndroid Build Coastguard Worker  // lot of data that was filtered out since the last committed row
428*d5c09012SAndroid Build Coastguard Worker  // key, allowing the client to skip that work on a retry.
429*d5c09012SAndroid Build Coastguard Worker  bytes last_scanned_row_key = 2;
430*d5c09012SAndroid Build Coastguard Worker
431*d5c09012SAndroid Build Coastguard Worker  //
432*d5c09012SAndroid Build Coastguard Worker  // If requested, provide enhanced query performance statistics. The semantics
433*d5c09012SAndroid Build Coastguard Worker  // dictate:
434*d5c09012SAndroid Build Coastguard Worker  //   * request_stats is empty on every (streamed) response, except
435*d5c09012SAndroid Build Coastguard Worker  //   * request_stats has non-empty information after all chunks have been
436*d5c09012SAndroid Build Coastguard Worker  //     streamed, where the ReadRowsResponse message only contains
437*d5c09012SAndroid Build Coastguard Worker  //     request_stats.
438*d5c09012SAndroid Build Coastguard Worker  //       * For example, if a read request would have returned an empty
439*d5c09012SAndroid Build Coastguard Worker  //         response instead a single ReadRowsResponse is streamed with empty
440*d5c09012SAndroid Build Coastguard Worker  //         chunks and request_stats filled.
441*d5c09012SAndroid Build Coastguard Worker  //
442*d5c09012SAndroid Build Coastguard Worker  // Visually, response messages will stream as follows:
443*d5c09012SAndroid Build Coastguard Worker  //    ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
444*d5c09012SAndroid Build Coastguard Worker  //   \______________________/  \________________________________/
445*d5c09012SAndroid Build Coastguard Worker  //       Primary response         Trailer of RequestStats info
446*d5c09012SAndroid Build Coastguard Worker  //
447*d5c09012SAndroid Build Coastguard Worker  // Or if the read did not return any values:
448*d5c09012SAndroid Build Coastguard Worker  //   {chunks: [], request_stats: {...}}
449*d5c09012SAndroid Build Coastguard Worker  //   \________________________________/
450*d5c09012SAndroid Build Coastguard Worker  //      Trailer of RequestStats info
451*d5c09012SAndroid Build Coastguard Worker  RequestStats request_stats = 3;
452*d5c09012SAndroid Build Coastguard Worker}
453*d5c09012SAndroid Build Coastguard Worker
454*d5c09012SAndroid Build Coastguard Worker// Request message for Bigtable.SampleRowKeys.
455*d5c09012SAndroid Build Coastguard Workermessage SampleRowKeysRequest {
456*d5c09012SAndroid Build Coastguard Worker  // Optional. The unique name of the table from which to sample row keys.
457*d5c09012SAndroid Build Coastguard Worker  //
458*d5c09012SAndroid Build Coastguard Worker  // Values are of the form
459*d5c09012SAndroid Build Coastguard Worker  // `projects/<project>/instances/<instance>/tables/<table>`.
460*d5c09012SAndroid Build Coastguard Worker  string table_name = 1 [
461*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = OPTIONAL,
462*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
463*d5c09012SAndroid Build Coastguard Worker      type: "bigtableadmin.googleapis.com/Table"
464*d5c09012SAndroid Build Coastguard Worker    }
465*d5c09012SAndroid Build Coastguard Worker  ];
466*d5c09012SAndroid Build Coastguard Worker
467*d5c09012SAndroid Build Coastguard Worker  // Optional. The unique name of the AuthorizedView from which to sample row
468*d5c09012SAndroid Build Coastguard Worker  // keys.
469*d5c09012SAndroid Build Coastguard Worker  //
470*d5c09012SAndroid Build Coastguard Worker  // Values are of the form
471*d5c09012SAndroid Build Coastguard Worker  // `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
472*d5c09012SAndroid Build Coastguard Worker  string authorized_view_name = 4 [
473*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = OPTIONAL,
474*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
475*d5c09012SAndroid Build Coastguard Worker      type: "bigtableadmin.googleapis.com/AuthorizedView"
476*d5c09012SAndroid Build Coastguard Worker    }
477*d5c09012SAndroid Build Coastguard Worker  ];
478*d5c09012SAndroid Build Coastguard Worker
479*d5c09012SAndroid Build Coastguard Worker  // This value specifies routing for replication. If not specified, the
480*d5c09012SAndroid Build Coastguard Worker  // "default" application profile will be used.
481*d5c09012SAndroid Build Coastguard Worker  string app_profile_id = 2;
482*d5c09012SAndroid Build Coastguard Worker}
483*d5c09012SAndroid Build Coastguard Worker
484*d5c09012SAndroid Build Coastguard Worker// Response message for Bigtable.SampleRowKeys.
485*d5c09012SAndroid Build Coastguard Workermessage SampleRowKeysResponse {
486*d5c09012SAndroid Build Coastguard Worker  // Sorted streamed sequence of sample row keys in the table. The table might
487*d5c09012SAndroid Build Coastguard Worker  // have contents before the first row key in the list and after the last one,
488*d5c09012SAndroid Build Coastguard Worker  // but a key containing the empty string indicates "end of table" and will be
489*d5c09012SAndroid Build Coastguard Worker  // the last response given, if present.
490*d5c09012SAndroid Build Coastguard Worker  // Note that row keys in this list may not have ever been written to or read
491*d5c09012SAndroid Build Coastguard Worker  // from, and users should therefore not make any assumptions about the row key
492*d5c09012SAndroid Build Coastguard Worker  // structure that are specific to their use case.
493*d5c09012SAndroid Build Coastguard Worker  bytes row_key = 1;
494*d5c09012SAndroid Build Coastguard Worker
495*d5c09012SAndroid Build Coastguard Worker  // Approximate total storage space used by all rows in the table which precede
496*d5c09012SAndroid Build Coastguard Worker  // `row_key`. Buffering the contents of all rows between two subsequent
497*d5c09012SAndroid Build Coastguard Worker  // samples would require space roughly equal to the difference in their
498*d5c09012SAndroid Build Coastguard Worker  // `offset_bytes` fields.
499*d5c09012SAndroid Build Coastguard Worker  int64 offset_bytes = 2;
500*d5c09012SAndroid Build Coastguard Worker}
501*d5c09012SAndroid Build Coastguard Worker
502*d5c09012SAndroid Build Coastguard Worker// Request message for Bigtable.MutateRow.
503*d5c09012SAndroid Build Coastguard Workermessage MutateRowRequest {
504*d5c09012SAndroid Build Coastguard Worker  // Optional. The unique name of the table to which the mutation should be
505*d5c09012SAndroid Build Coastguard Worker  // applied.
506*d5c09012SAndroid Build Coastguard Worker  //
507*d5c09012SAndroid Build Coastguard Worker  // Values are of the form
508*d5c09012SAndroid Build Coastguard Worker  // `projects/<project>/instances/<instance>/tables/<table>`.
509*d5c09012SAndroid Build Coastguard Worker  string table_name = 1 [
510*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = OPTIONAL,
511*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
512*d5c09012SAndroid Build Coastguard Worker      type: "bigtableadmin.googleapis.com/Table"
513*d5c09012SAndroid Build Coastguard Worker    }
514*d5c09012SAndroid Build Coastguard Worker  ];
515*d5c09012SAndroid Build Coastguard Worker
516*d5c09012SAndroid Build Coastguard Worker  // Optional. The unique name of the AuthorizedView to which the mutation
517*d5c09012SAndroid Build Coastguard Worker  // should be applied.
518*d5c09012SAndroid Build Coastguard Worker  //
519*d5c09012SAndroid Build Coastguard Worker  // Values are of the form
520*d5c09012SAndroid Build Coastguard Worker  // `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
521*d5c09012SAndroid Build Coastguard Worker  string authorized_view_name = 6 [
522*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = OPTIONAL,
523*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
524*d5c09012SAndroid Build Coastguard Worker      type: "bigtableadmin.googleapis.com/AuthorizedView"
525*d5c09012SAndroid Build Coastguard Worker    }
526*d5c09012SAndroid Build Coastguard Worker  ];
527*d5c09012SAndroid Build Coastguard Worker
528*d5c09012SAndroid Build Coastguard Worker  // This value specifies routing for replication. If not specified, the
529*d5c09012SAndroid Build Coastguard Worker  // "default" application profile will be used.
530*d5c09012SAndroid Build Coastguard Worker  string app_profile_id = 4;
531*d5c09012SAndroid Build Coastguard Worker
532*d5c09012SAndroid Build Coastguard Worker  // Required. The key of the row to which the mutation should be applied.
533*d5c09012SAndroid Build Coastguard Worker  bytes row_key = 2 [(google.api.field_behavior) = REQUIRED];
534*d5c09012SAndroid Build Coastguard Worker
535*d5c09012SAndroid Build Coastguard Worker  // Required. Changes to be atomically applied to the specified row. Entries
536*d5c09012SAndroid Build Coastguard Worker  // are applied in order, meaning that earlier mutations can be masked by later
537*d5c09012SAndroid Build Coastguard Worker  // ones. Must contain at least one entry and at most 100000.
538*d5c09012SAndroid Build Coastguard Worker  repeated Mutation mutations = 3 [(google.api.field_behavior) = REQUIRED];
539*d5c09012SAndroid Build Coastguard Worker}
540*d5c09012SAndroid Build Coastguard Worker
541*d5c09012SAndroid Build Coastguard Worker// Response message for Bigtable.MutateRow.
542*d5c09012SAndroid Build Coastguard Workermessage MutateRowResponse {}
543*d5c09012SAndroid Build Coastguard Worker
544*d5c09012SAndroid Build Coastguard Worker// Request message for BigtableService.MutateRows.
545*d5c09012SAndroid Build Coastguard Workermessage MutateRowsRequest {
546*d5c09012SAndroid Build Coastguard Worker  // A mutation for a given row.
547*d5c09012SAndroid Build Coastguard Worker  message Entry {
548*d5c09012SAndroid Build Coastguard Worker    // The key of the row to which the `mutations` should be applied.
549*d5c09012SAndroid Build Coastguard Worker    bytes row_key = 1;
550*d5c09012SAndroid Build Coastguard Worker
551*d5c09012SAndroid Build Coastguard Worker    // Required. Changes to be atomically applied to the specified row.
552*d5c09012SAndroid Build Coastguard Worker    // Mutations are applied in order, meaning that earlier mutations can be
553*d5c09012SAndroid Build Coastguard Worker    // masked by later ones. You must specify at least one mutation.
554*d5c09012SAndroid Build Coastguard Worker    repeated Mutation mutations = 2 [(google.api.field_behavior) = REQUIRED];
555*d5c09012SAndroid Build Coastguard Worker  }
556*d5c09012SAndroid Build Coastguard Worker
557*d5c09012SAndroid Build Coastguard Worker  // Optional. The unique name of the table to which the mutations should be
558*d5c09012SAndroid Build Coastguard Worker  // applied.
559*d5c09012SAndroid Build Coastguard Worker  //
560*d5c09012SAndroid Build Coastguard Worker  // Values are of the form
561*d5c09012SAndroid Build Coastguard Worker  // `projects/<project>/instances/<instance>/tables/<table>`.
562*d5c09012SAndroid Build Coastguard Worker  string table_name = 1 [
563*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = OPTIONAL,
564*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
565*d5c09012SAndroid Build Coastguard Worker      type: "bigtableadmin.googleapis.com/Table"
566*d5c09012SAndroid Build Coastguard Worker    }
567*d5c09012SAndroid Build Coastguard Worker  ];
568*d5c09012SAndroid Build Coastguard Worker
569*d5c09012SAndroid Build Coastguard Worker  // Optional. The unique name of the AuthorizedView to which the mutations
570*d5c09012SAndroid Build Coastguard Worker  // should be applied.
571*d5c09012SAndroid Build Coastguard Worker  //
572*d5c09012SAndroid Build Coastguard Worker  // Values are of the form
573*d5c09012SAndroid Build Coastguard Worker  // `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
574*d5c09012SAndroid Build Coastguard Worker  string authorized_view_name = 5 [
575*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = OPTIONAL,
576*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
577*d5c09012SAndroid Build Coastguard Worker      type: "bigtableadmin.googleapis.com/AuthorizedView"
578*d5c09012SAndroid Build Coastguard Worker    }
579*d5c09012SAndroid Build Coastguard Worker  ];
580*d5c09012SAndroid Build Coastguard Worker
581*d5c09012SAndroid Build Coastguard Worker  // This value specifies routing for replication. If not specified, the
582*d5c09012SAndroid Build Coastguard Worker  // "default" application profile will be used.
583*d5c09012SAndroid Build Coastguard Worker  string app_profile_id = 3;
584*d5c09012SAndroid Build Coastguard Worker
585*d5c09012SAndroid Build Coastguard Worker  // Required. The row keys and corresponding mutations to be applied in bulk.
586*d5c09012SAndroid Build Coastguard Worker  // Each entry is applied as an atomic mutation, but the entries may be
587*d5c09012SAndroid Build Coastguard Worker  // applied in arbitrary order (even between entries for the same row).
588*d5c09012SAndroid Build Coastguard Worker  // At least one entry must be specified, and in total the entries can
589*d5c09012SAndroid Build Coastguard Worker  // contain at most 100000 mutations.
590*d5c09012SAndroid Build Coastguard Worker  repeated Entry entries = 2 [(google.api.field_behavior) = REQUIRED];
591*d5c09012SAndroid Build Coastguard Worker}
592*d5c09012SAndroid Build Coastguard Worker
593*d5c09012SAndroid Build Coastguard Worker// Response message for BigtableService.MutateRows.
594*d5c09012SAndroid Build Coastguard Workermessage MutateRowsResponse {
595*d5c09012SAndroid Build Coastguard Worker  // The result of applying a passed mutation in the original request.
596*d5c09012SAndroid Build Coastguard Worker  message Entry {
597*d5c09012SAndroid Build Coastguard Worker    // The index into the original request's `entries` list of the Entry
598*d5c09012SAndroid Build Coastguard Worker    // for which a result is being reported.
599*d5c09012SAndroid Build Coastguard Worker    int64 index = 1;
600*d5c09012SAndroid Build Coastguard Worker
601*d5c09012SAndroid Build Coastguard Worker    // The result of the request Entry identified by `index`.
602*d5c09012SAndroid Build Coastguard Worker    // Depending on how requests are batched during execution, it is possible
603*d5c09012SAndroid Build Coastguard Worker    // for one Entry to fail due to an error with another Entry. In the event
604*d5c09012SAndroid Build Coastguard Worker    // that this occurs, the same error will be reported for both entries.
605*d5c09012SAndroid Build Coastguard Worker    google.rpc.Status status = 2;
606*d5c09012SAndroid Build Coastguard Worker  }
607*d5c09012SAndroid Build Coastguard Worker
608*d5c09012SAndroid Build Coastguard Worker  // One or more results for Entries from the batch request.
609*d5c09012SAndroid Build Coastguard Worker  repeated Entry entries = 1;
610*d5c09012SAndroid Build Coastguard Worker
611*d5c09012SAndroid Build Coastguard Worker  // Information about how client should limit the rate (QPS). Primirily used by
612*d5c09012SAndroid Build Coastguard Worker  // supported official Cloud Bigtable clients. If unset, the rate limit info is
613*d5c09012SAndroid Build Coastguard Worker  // not provided by the server.
614*d5c09012SAndroid Build Coastguard Worker  optional RateLimitInfo rate_limit_info = 3;
615*d5c09012SAndroid Build Coastguard Worker}
616*d5c09012SAndroid Build Coastguard Worker
617*d5c09012SAndroid Build Coastguard Worker// Information about how client should adjust the load to Bigtable.
618*d5c09012SAndroid Build Coastguard Workermessage RateLimitInfo {
619*d5c09012SAndroid Build Coastguard Worker  // Time that clients should wait before adjusting the target rate again.
620*d5c09012SAndroid Build Coastguard Worker  // If clients adjust rate too frequently, the impact of the previous
621*d5c09012SAndroid Build Coastguard Worker  // adjustment may not have been taken into account and may
622*d5c09012SAndroid Build Coastguard Worker  // over-throttle or under-throttle. If clients adjust rate too slowly, they
623*d5c09012SAndroid Build Coastguard Worker  // will not be responsive to load changes on server side, and may
624*d5c09012SAndroid Build Coastguard Worker  // over-throttle or under-throttle.
625*d5c09012SAndroid Build Coastguard Worker  google.protobuf.Duration period = 1;
626*d5c09012SAndroid Build Coastguard Worker
627*d5c09012SAndroid Build Coastguard Worker  // If it has been at least one `period` since the last load adjustment, the
628*d5c09012SAndroid Build Coastguard Worker  // client should multiply the current load by this value to get the new target
629*d5c09012SAndroid Build Coastguard Worker  // load. For example, if the current load is 100 and `factor` is 0.8, the new
630*d5c09012SAndroid Build Coastguard Worker  // target load should be 80. After adjusting, the client should ignore
631*d5c09012SAndroid Build Coastguard Worker  // `factor` until another `period` has passed.
632*d5c09012SAndroid Build Coastguard Worker  //
633*d5c09012SAndroid Build Coastguard Worker  // The client can measure its load using any unit that's comparable over time
634*d5c09012SAndroid Build Coastguard Worker  // For example, QPS can be used as long as each request involves a similar
635*d5c09012SAndroid Build Coastguard Worker  // amount of work.
636*d5c09012SAndroid Build Coastguard Worker  double factor = 2;
637*d5c09012SAndroid Build Coastguard Worker}
638*d5c09012SAndroid Build Coastguard Worker
639*d5c09012SAndroid Build Coastguard Worker// Request message for Bigtable.CheckAndMutateRow.
640*d5c09012SAndroid Build Coastguard Workermessage CheckAndMutateRowRequest {
641*d5c09012SAndroid Build Coastguard Worker  // Optional. The unique name of the table to which the conditional mutation
642*d5c09012SAndroid Build Coastguard Worker  // should be applied.
643*d5c09012SAndroid Build Coastguard Worker  //
644*d5c09012SAndroid Build Coastguard Worker  // Values are of the form
645*d5c09012SAndroid Build Coastguard Worker  // `projects/<project>/instances/<instance>/tables/<table>`.
646*d5c09012SAndroid Build Coastguard Worker  string table_name = 1 [
647*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = OPTIONAL,
648*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
649*d5c09012SAndroid Build Coastguard Worker      type: "bigtableadmin.googleapis.com/Table"
650*d5c09012SAndroid Build Coastguard Worker    }
651*d5c09012SAndroid Build Coastguard Worker  ];
652*d5c09012SAndroid Build Coastguard Worker
653*d5c09012SAndroid Build Coastguard Worker  // Optional. The unique name of the AuthorizedView to which the conditional
654*d5c09012SAndroid Build Coastguard Worker  // mutation should be applied.
655*d5c09012SAndroid Build Coastguard Worker  //
656*d5c09012SAndroid Build Coastguard Worker  // Values are of the form
657*d5c09012SAndroid Build Coastguard Worker  // `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
658*d5c09012SAndroid Build Coastguard Worker  string authorized_view_name = 9 [
659*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = OPTIONAL,
660*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
661*d5c09012SAndroid Build Coastguard Worker      type: "bigtableadmin.googleapis.com/AuthorizedView"
662*d5c09012SAndroid Build Coastguard Worker    }
663*d5c09012SAndroid Build Coastguard Worker  ];
664*d5c09012SAndroid Build Coastguard Worker
665*d5c09012SAndroid Build Coastguard Worker  // This value specifies routing for replication. If not specified, the
666*d5c09012SAndroid Build Coastguard Worker  // "default" application profile will be used.
667*d5c09012SAndroid Build Coastguard Worker  string app_profile_id = 7;
668*d5c09012SAndroid Build Coastguard Worker
669*d5c09012SAndroid Build Coastguard Worker  // Required. The key of the row to which the conditional mutation should be
670*d5c09012SAndroid Build Coastguard Worker  // applied.
671*d5c09012SAndroid Build Coastguard Worker  bytes row_key = 2 [(google.api.field_behavior) = REQUIRED];
672*d5c09012SAndroid Build Coastguard Worker
673*d5c09012SAndroid Build Coastguard Worker  // The filter to be applied to the contents of the specified row. Depending
674*d5c09012SAndroid Build Coastguard Worker  // on whether or not any results are yielded, either `true_mutations` or
675*d5c09012SAndroid Build Coastguard Worker  // `false_mutations` will be executed. If unset, checks that the row contains
676*d5c09012SAndroid Build Coastguard Worker  // any values at all.
677*d5c09012SAndroid Build Coastguard Worker  RowFilter predicate_filter = 6;
678*d5c09012SAndroid Build Coastguard Worker
679*d5c09012SAndroid Build Coastguard Worker  // Changes to be atomically applied to the specified row if `predicate_filter`
680*d5c09012SAndroid Build Coastguard Worker  // yields at least one cell when applied to `row_key`. Entries are applied in
681*d5c09012SAndroid Build Coastguard Worker  // order, meaning that earlier mutations can be masked by later ones.
682*d5c09012SAndroid Build Coastguard Worker  // Must contain at least one entry if `false_mutations` is empty, and at most
683*d5c09012SAndroid Build Coastguard Worker  // 100000.
684*d5c09012SAndroid Build Coastguard Worker  repeated Mutation true_mutations = 4;
685*d5c09012SAndroid Build Coastguard Worker
686*d5c09012SAndroid Build Coastguard Worker  // Changes to be atomically applied to the specified row if `predicate_filter`
687*d5c09012SAndroid Build Coastguard Worker  // does not yield any cells when applied to `row_key`. Entries are applied in
688*d5c09012SAndroid Build Coastguard Worker  // order, meaning that earlier mutations can be masked by later ones.
689*d5c09012SAndroid Build Coastguard Worker  // Must contain at least one entry if `true_mutations` is empty, and at most
690*d5c09012SAndroid Build Coastguard Worker  // 100000.
691*d5c09012SAndroid Build Coastguard Worker  repeated Mutation false_mutations = 5;
692*d5c09012SAndroid Build Coastguard Worker}
693*d5c09012SAndroid Build Coastguard Worker
694*d5c09012SAndroid Build Coastguard Worker// Response message for Bigtable.CheckAndMutateRow.
695*d5c09012SAndroid Build Coastguard Workermessage CheckAndMutateRowResponse {
696*d5c09012SAndroid Build Coastguard Worker  // Whether or not the request's `predicate_filter` yielded any results for
697*d5c09012SAndroid Build Coastguard Worker  // the specified row.
698*d5c09012SAndroid Build Coastguard Worker  bool predicate_matched = 1;
699*d5c09012SAndroid Build Coastguard Worker}
700*d5c09012SAndroid Build Coastguard Worker
701*d5c09012SAndroid Build Coastguard Worker// Request message for client connection keep-alive and warming.
702*d5c09012SAndroid Build Coastguard Workermessage PingAndWarmRequest {
703*d5c09012SAndroid Build Coastguard Worker  // Required. The unique name of the instance to check permissions for as well
704*d5c09012SAndroid Build Coastguard Worker  // as respond. Values are of the form
705*d5c09012SAndroid Build Coastguard Worker  // `projects/<project>/instances/<instance>`.
706*d5c09012SAndroid Build Coastguard Worker  string name = 1 [
707*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
708*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
709*d5c09012SAndroid Build Coastguard Worker      type: "bigtableadmin.googleapis.com/Instance"
710*d5c09012SAndroid Build Coastguard Worker    }
711*d5c09012SAndroid Build Coastguard Worker  ];
712*d5c09012SAndroid Build Coastguard Worker
713*d5c09012SAndroid Build Coastguard Worker  // This value specifies routing for replication. If not specified, the
714*d5c09012SAndroid Build Coastguard Worker  // "default" application profile will be used.
715*d5c09012SAndroid Build Coastguard Worker  string app_profile_id = 2;
716*d5c09012SAndroid Build Coastguard Worker}
717*d5c09012SAndroid Build Coastguard Worker
718*d5c09012SAndroid Build Coastguard Worker// Response message for Bigtable.PingAndWarm connection keepalive and warming.
719*d5c09012SAndroid Build Coastguard Workermessage PingAndWarmResponse {}
720*d5c09012SAndroid Build Coastguard Worker
721*d5c09012SAndroid Build Coastguard Worker// Request message for Bigtable.ReadModifyWriteRow.
722*d5c09012SAndroid Build Coastguard Workermessage ReadModifyWriteRowRequest {
723*d5c09012SAndroid Build Coastguard Worker  // Optional. The unique name of the table to which the read/modify/write rules
724*d5c09012SAndroid Build Coastguard Worker  // should be applied.
725*d5c09012SAndroid Build Coastguard Worker  //
726*d5c09012SAndroid Build Coastguard Worker  // Values are of the form
727*d5c09012SAndroid Build Coastguard Worker  // `projects/<project>/instances/<instance>/tables/<table>`.
728*d5c09012SAndroid Build Coastguard Worker  string table_name = 1 [
729*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = OPTIONAL,
730*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
731*d5c09012SAndroid Build Coastguard Worker      type: "bigtableadmin.googleapis.com/Table"
732*d5c09012SAndroid Build Coastguard Worker    }
733*d5c09012SAndroid Build Coastguard Worker  ];
734*d5c09012SAndroid Build Coastguard Worker
735*d5c09012SAndroid Build Coastguard Worker  // Optional. The unique name of the AuthorizedView to which the
736*d5c09012SAndroid Build Coastguard Worker  // read/modify/write rules should be applied.
737*d5c09012SAndroid Build Coastguard Worker  //
738*d5c09012SAndroid Build Coastguard Worker  // Values are of the form
739*d5c09012SAndroid Build Coastguard Worker  // `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
740*d5c09012SAndroid Build Coastguard Worker  string authorized_view_name = 6 [
741*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = OPTIONAL,
742*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
743*d5c09012SAndroid Build Coastguard Worker      type: "bigtableadmin.googleapis.com/AuthorizedView"
744*d5c09012SAndroid Build Coastguard Worker    }
745*d5c09012SAndroid Build Coastguard Worker  ];
746*d5c09012SAndroid Build Coastguard Worker
747*d5c09012SAndroid Build Coastguard Worker  // This value specifies routing for replication. If not specified, the
748*d5c09012SAndroid Build Coastguard Worker  // "default" application profile will be used.
749*d5c09012SAndroid Build Coastguard Worker  string app_profile_id = 4;
750*d5c09012SAndroid Build Coastguard Worker
751*d5c09012SAndroid Build Coastguard Worker  // Required. The key of the row to which the read/modify/write rules should be
752*d5c09012SAndroid Build Coastguard Worker  // applied.
753*d5c09012SAndroid Build Coastguard Worker  bytes row_key = 2 [(google.api.field_behavior) = REQUIRED];
754*d5c09012SAndroid Build Coastguard Worker
755*d5c09012SAndroid Build Coastguard Worker  // Required. Rules specifying how the specified row's contents are to be
756*d5c09012SAndroid Build Coastguard Worker  // transformed into writes. Entries are applied in order, meaning that earlier
757*d5c09012SAndroid Build Coastguard Worker  // rules will affect the results of later ones.
758*d5c09012SAndroid Build Coastguard Worker  repeated ReadModifyWriteRule rules = 3
759*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = REQUIRED];
760*d5c09012SAndroid Build Coastguard Worker}
761*d5c09012SAndroid Build Coastguard Worker
762*d5c09012SAndroid Build Coastguard Worker// Response message for Bigtable.ReadModifyWriteRow.
763*d5c09012SAndroid Build Coastguard Workermessage ReadModifyWriteRowResponse {
764*d5c09012SAndroid Build Coastguard Worker  // A Row containing the new contents of all cells modified by the request.
765*d5c09012SAndroid Build Coastguard Worker  Row row = 1;
766*d5c09012SAndroid Build Coastguard Worker}
767*d5c09012SAndroid Build Coastguard Worker
768*d5c09012SAndroid Build Coastguard Worker// NOTE: This API is intended to be used by Apache Beam BigtableIO.
769*d5c09012SAndroid Build Coastguard Worker// Request message for Bigtable.GenerateInitialChangeStreamPartitions.
770*d5c09012SAndroid Build Coastguard Workermessage GenerateInitialChangeStreamPartitionsRequest {
771*d5c09012SAndroid Build Coastguard Worker  // Required. The unique name of the table from which to get change stream
772*d5c09012SAndroid Build Coastguard Worker  // partitions. Values are of the form
773*d5c09012SAndroid Build Coastguard Worker  // `projects/<project>/instances/<instance>/tables/<table>`.
774*d5c09012SAndroid Build Coastguard Worker  // Change streaming must be enabled on the table.
775*d5c09012SAndroid Build Coastguard Worker  string table_name = 1 [
776*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
777*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
778*d5c09012SAndroid Build Coastguard Worker      type: "bigtableadmin.googleapis.com/Table"
779*d5c09012SAndroid Build Coastguard Worker    }
780*d5c09012SAndroid Build Coastguard Worker  ];
781*d5c09012SAndroid Build Coastguard Worker
782*d5c09012SAndroid Build Coastguard Worker  // This value specifies routing for replication. If not specified, the
783*d5c09012SAndroid Build Coastguard Worker  // "default" application profile will be used.
784*d5c09012SAndroid Build Coastguard Worker  // Single cluster routing must be configured on the profile.
785*d5c09012SAndroid Build Coastguard Worker  string app_profile_id = 2;
786*d5c09012SAndroid Build Coastguard Worker}
787*d5c09012SAndroid Build Coastguard Worker
788*d5c09012SAndroid Build Coastguard Worker// NOTE: This API is intended to be used by Apache Beam BigtableIO.
789*d5c09012SAndroid Build Coastguard Worker// Response message for Bigtable.GenerateInitialChangeStreamPartitions.
790*d5c09012SAndroid Build Coastguard Workermessage GenerateInitialChangeStreamPartitionsResponse {
791*d5c09012SAndroid Build Coastguard Worker  // A partition of the change stream.
792*d5c09012SAndroid Build Coastguard Worker  StreamPartition partition = 1;
793*d5c09012SAndroid Build Coastguard Worker}
794*d5c09012SAndroid Build Coastguard Worker
795*d5c09012SAndroid Build Coastguard Worker// NOTE: This API is intended to be used by Apache Beam BigtableIO.
796*d5c09012SAndroid Build Coastguard Worker// Request message for Bigtable.ReadChangeStream.
797*d5c09012SAndroid Build Coastguard Workermessage ReadChangeStreamRequest {
798*d5c09012SAndroid Build Coastguard Worker  // Required. The unique name of the table from which to read a change stream.
799*d5c09012SAndroid Build Coastguard Worker  // Values are of the form
800*d5c09012SAndroid Build Coastguard Worker  // `projects/<project>/instances/<instance>/tables/<table>`.
801*d5c09012SAndroid Build Coastguard Worker  // Change streaming must be enabled on the table.
802*d5c09012SAndroid Build Coastguard Worker  string table_name = 1 [
803*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
804*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
805*d5c09012SAndroid Build Coastguard Worker      type: "bigtableadmin.googleapis.com/Table"
806*d5c09012SAndroid Build Coastguard Worker    }
807*d5c09012SAndroid Build Coastguard Worker  ];
808*d5c09012SAndroid Build Coastguard Worker
809*d5c09012SAndroid Build Coastguard Worker  // This value specifies routing for replication. If not specified, the
810*d5c09012SAndroid Build Coastguard Worker  // "default" application profile will be used.
811*d5c09012SAndroid Build Coastguard Worker  // Single cluster routing must be configured on the profile.
812*d5c09012SAndroid Build Coastguard Worker  string app_profile_id = 2;
813*d5c09012SAndroid Build Coastguard Worker
814*d5c09012SAndroid Build Coastguard Worker  // The partition to read changes from.
815*d5c09012SAndroid Build Coastguard Worker  StreamPartition partition = 3;
816*d5c09012SAndroid Build Coastguard Worker
817*d5c09012SAndroid Build Coastguard Worker  // Options for describing where we want to start reading from the stream.
818*d5c09012SAndroid Build Coastguard Worker  oneof start_from {
819*d5c09012SAndroid Build Coastguard Worker    // Start reading the stream at the specified timestamp. This timestamp must
820*d5c09012SAndroid Build Coastguard Worker    // be within the change stream retention period, less than or equal to the
821*d5c09012SAndroid Build Coastguard Worker    // current time, and after change stream creation, whichever is greater.
822*d5c09012SAndroid Build Coastguard Worker    // This value is inclusive and will be truncated to microsecond granularity.
823*d5c09012SAndroid Build Coastguard Worker    google.protobuf.Timestamp start_time = 4;
824*d5c09012SAndroid Build Coastguard Worker
825*d5c09012SAndroid Build Coastguard Worker    // Tokens that describe how to resume reading a stream where reading
826*d5c09012SAndroid Build Coastguard Worker    // previously left off. If specified, changes will be read starting at the
827*d5c09012SAndroid Build Coastguard Worker    // the position. Tokens are delivered on the stream as part of `Heartbeat`
828*d5c09012SAndroid Build Coastguard Worker    // and `CloseStream` messages.
829*d5c09012SAndroid Build Coastguard Worker    //
830*d5c09012SAndroid Build Coastguard Worker    // If a single token is provided, the token’s partition must exactly match
831*d5c09012SAndroid Build Coastguard Worker    // the request’s partition. If multiple tokens are provided, as in the case
832*d5c09012SAndroid Build Coastguard Worker    // of a partition merge, the union of the token partitions must exactly
833*d5c09012SAndroid Build Coastguard Worker    // cover the request’s partition. Otherwise, INVALID_ARGUMENT will be
834*d5c09012SAndroid Build Coastguard Worker    // returned.
835*d5c09012SAndroid Build Coastguard Worker    StreamContinuationTokens continuation_tokens = 6;
836*d5c09012SAndroid Build Coastguard Worker  }
837*d5c09012SAndroid Build Coastguard Worker
838*d5c09012SAndroid Build Coastguard Worker  // If specified, OK will be returned when the stream advances beyond
839*d5c09012SAndroid Build Coastguard Worker  // this time. Otherwise, changes will be continuously delivered on the stream.
840*d5c09012SAndroid Build Coastguard Worker  // This value is inclusive and will be truncated to microsecond granularity.
841*d5c09012SAndroid Build Coastguard Worker  google.protobuf.Timestamp end_time = 5;
842*d5c09012SAndroid Build Coastguard Worker
843*d5c09012SAndroid Build Coastguard Worker  // If specified, the duration between `Heartbeat` messages on the stream.
844*d5c09012SAndroid Build Coastguard Worker  // Otherwise, defaults to 5 seconds.
845*d5c09012SAndroid Build Coastguard Worker  google.protobuf.Duration heartbeat_duration = 7;
846*d5c09012SAndroid Build Coastguard Worker}
847*d5c09012SAndroid Build Coastguard Worker
848*d5c09012SAndroid Build Coastguard Worker// NOTE: This API is intended to be used by Apache Beam BigtableIO.
849*d5c09012SAndroid Build Coastguard Worker// Response message for Bigtable.ReadChangeStream.
850*d5c09012SAndroid Build Coastguard Workermessage ReadChangeStreamResponse {
851*d5c09012SAndroid Build Coastguard Worker  // A partial or complete mutation.
852*d5c09012SAndroid Build Coastguard Worker  message MutationChunk {
853*d5c09012SAndroid Build Coastguard Worker    // Information about the chunking of this mutation.
854*d5c09012SAndroid Build Coastguard Worker    // Only `SetCell` mutations can be chunked, and all chunks for a `SetCell`
855*d5c09012SAndroid Build Coastguard Worker    // will be delivered contiguously with no other mutation types interleaved.
856*d5c09012SAndroid Build Coastguard Worker    message ChunkInfo {
857*d5c09012SAndroid Build Coastguard Worker      // The total value size of all the chunks that make up the `SetCell`.
858*d5c09012SAndroid Build Coastguard Worker      int32 chunked_value_size = 1;
859*d5c09012SAndroid Build Coastguard Worker
860*d5c09012SAndroid Build Coastguard Worker      // The byte offset of this chunk into the total value size of the
861*d5c09012SAndroid Build Coastguard Worker      // mutation.
862*d5c09012SAndroid Build Coastguard Worker      int32 chunked_value_offset = 2;
863*d5c09012SAndroid Build Coastguard Worker
864*d5c09012SAndroid Build Coastguard Worker      // When true, this is the last chunk of a chunked `SetCell`.
865*d5c09012SAndroid Build Coastguard Worker      bool last_chunk = 3;
866*d5c09012SAndroid Build Coastguard Worker    }
867*d5c09012SAndroid Build Coastguard Worker
868*d5c09012SAndroid Build Coastguard Worker    // If set, then the mutation is a `SetCell` with a chunked value across
869*d5c09012SAndroid Build Coastguard Worker    // multiple messages.
870*d5c09012SAndroid Build Coastguard Worker    ChunkInfo chunk_info = 1;
871*d5c09012SAndroid Build Coastguard Worker
872*d5c09012SAndroid Build Coastguard Worker    // If this is a continuation of a chunked message (`chunked_value_offset` >
873*d5c09012SAndroid Build Coastguard Worker    // 0), ignore all fields except the `SetCell`'s value and merge it with
874*d5c09012SAndroid Build Coastguard Worker    // the previous message by concatenating the value fields.
875*d5c09012SAndroid Build Coastguard Worker    Mutation mutation = 2;
876*d5c09012SAndroid Build Coastguard Worker  }
877*d5c09012SAndroid Build Coastguard Worker
878*d5c09012SAndroid Build Coastguard Worker  // A message corresponding to one or more mutations to the partition
879*d5c09012SAndroid Build Coastguard Worker  // being streamed. A single logical `DataChange` message may also be split
880*d5c09012SAndroid Build Coastguard Worker  // across a sequence of multiple individual messages. Messages other than
881*d5c09012SAndroid Build Coastguard Worker  // the first in a sequence will only have the `type` and `chunks` fields
882*d5c09012SAndroid Build Coastguard Worker  // populated, with the final message in the sequence also containing `done`
883*d5c09012SAndroid Build Coastguard Worker  // set to true.
884*d5c09012SAndroid Build Coastguard Worker  message DataChange {
885*d5c09012SAndroid Build Coastguard Worker    // The type of mutation.
886*d5c09012SAndroid Build Coastguard Worker    enum Type {
887*d5c09012SAndroid Build Coastguard Worker      // The type is unspecified.
888*d5c09012SAndroid Build Coastguard Worker      TYPE_UNSPECIFIED = 0;
889*d5c09012SAndroid Build Coastguard Worker
890*d5c09012SAndroid Build Coastguard Worker      // A user-initiated mutation.
891*d5c09012SAndroid Build Coastguard Worker      USER = 1;
892*d5c09012SAndroid Build Coastguard Worker
893*d5c09012SAndroid Build Coastguard Worker      // A system-initiated mutation as part of garbage collection.
894*d5c09012SAndroid Build Coastguard Worker      // https://cloud.google.com/bigtable/docs/garbage-collection
895*d5c09012SAndroid Build Coastguard Worker      GARBAGE_COLLECTION = 2;
896*d5c09012SAndroid Build Coastguard Worker
897*d5c09012SAndroid Build Coastguard Worker      // This is a continuation of a multi-message change.
898*d5c09012SAndroid Build Coastguard Worker      CONTINUATION = 3;
899*d5c09012SAndroid Build Coastguard Worker    }
900*d5c09012SAndroid Build Coastguard Worker
901*d5c09012SAndroid Build Coastguard Worker    // The type of the mutation.
902*d5c09012SAndroid Build Coastguard Worker    Type type = 1;
903*d5c09012SAndroid Build Coastguard Worker
904*d5c09012SAndroid Build Coastguard Worker    // The cluster where the mutation was applied.
905*d5c09012SAndroid Build Coastguard Worker    // Not set when `type` is `GARBAGE_COLLECTION`.
906*d5c09012SAndroid Build Coastguard Worker    string source_cluster_id = 2;
907*d5c09012SAndroid Build Coastguard Worker
908*d5c09012SAndroid Build Coastguard Worker    // The row key for all mutations that are part of this `DataChange`.
909*d5c09012SAndroid Build Coastguard Worker    // If the `DataChange` is chunked across multiple messages, then this field
910*d5c09012SAndroid Build Coastguard Worker    // will only be set for the first message.
911*d5c09012SAndroid Build Coastguard Worker    bytes row_key = 3;
912*d5c09012SAndroid Build Coastguard Worker
913*d5c09012SAndroid Build Coastguard Worker    // The timestamp at which the mutation was applied on the Bigtable server.
914*d5c09012SAndroid Build Coastguard Worker    google.protobuf.Timestamp commit_timestamp = 4;
915*d5c09012SAndroid Build Coastguard Worker
916*d5c09012SAndroid Build Coastguard Worker    // A value that lets stream consumers reconstruct Bigtable's
917*d5c09012SAndroid Build Coastguard Worker    // conflict resolution semantics.
918*d5c09012SAndroid Build Coastguard Worker    // https://cloud.google.com/bigtable/docs/writes#conflict-resolution
919*d5c09012SAndroid Build Coastguard Worker    // In the event that the same row key, column family, column qualifier,
920*d5c09012SAndroid Build Coastguard Worker    // timestamp are modified on different clusters at the same
921*d5c09012SAndroid Build Coastguard Worker    // `commit_timestamp`, the mutation with the larger `tiebreaker` will be the
922*d5c09012SAndroid Build Coastguard Worker    // one chosen for the eventually consistent state of the system.
923*d5c09012SAndroid Build Coastguard Worker    int32 tiebreaker = 5;
924*d5c09012SAndroid Build Coastguard Worker
925*d5c09012SAndroid Build Coastguard Worker    // The mutations associated with this change to the partition.
926*d5c09012SAndroid Build Coastguard Worker    // May contain complete mutations or chunks of a multi-message chunked
927*d5c09012SAndroid Build Coastguard Worker    // `DataChange` record.
928*d5c09012SAndroid Build Coastguard Worker    repeated MutationChunk chunks = 6;
929*d5c09012SAndroid Build Coastguard Worker
930*d5c09012SAndroid Build Coastguard Worker    // When true, indicates that the entire `DataChange` has been read
931*d5c09012SAndroid Build Coastguard Worker    // and the client can safely process the message.
932*d5c09012SAndroid Build Coastguard Worker    bool done = 8;
933*d5c09012SAndroid Build Coastguard Worker
934*d5c09012SAndroid Build Coastguard Worker    // An encoded position for this stream's partition to restart reading from.
935*d5c09012SAndroid Build Coastguard Worker    // This token is for the StreamPartition from the request.
936*d5c09012SAndroid Build Coastguard Worker    string token = 9;
937*d5c09012SAndroid Build Coastguard Worker
938*d5c09012SAndroid Build Coastguard Worker    // An estimate of the commit timestamp that is usually lower than or equal
939*d5c09012SAndroid Build Coastguard Worker    // to any timestamp for a record that will be delivered in the future on the
940*d5c09012SAndroid Build Coastguard Worker    // stream. It is possible that, under particular circumstances that a future
941*d5c09012SAndroid Build Coastguard Worker    // record has a timestamp is is lower than a previously seen timestamp. For
942*d5c09012SAndroid Build Coastguard Worker    // an example usage see
943*d5c09012SAndroid Build Coastguard Worker    // https://beam.apache.org/documentation/basics/#watermarks
944*d5c09012SAndroid Build Coastguard Worker    google.protobuf.Timestamp estimated_low_watermark = 10;
945*d5c09012SAndroid Build Coastguard Worker  }
946*d5c09012SAndroid Build Coastguard Worker
947*d5c09012SAndroid Build Coastguard Worker  // A periodic message with information that can be used to checkpoint
948*d5c09012SAndroid Build Coastguard Worker  // the state of a stream.
949*d5c09012SAndroid Build Coastguard Worker  message Heartbeat {
950*d5c09012SAndroid Build Coastguard Worker    // A token that can be provided to a subsequent `ReadChangeStream` call
951*d5c09012SAndroid Build Coastguard Worker    // to pick up reading at the current stream position.
952*d5c09012SAndroid Build Coastguard Worker    StreamContinuationToken continuation_token = 1;
953*d5c09012SAndroid Build Coastguard Worker
954*d5c09012SAndroid Build Coastguard Worker    // An estimate of the commit timestamp that is usually lower than or equal
955*d5c09012SAndroid Build Coastguard Worker    // to any timestamp for a record that will be delivered in the future on the
956*d5c09012SAndroid Build Coastguard Worker    // stream. It is possible that, under particular circumstances that a future
957*d5c09012SAndroid Build Coastguard Worker    // record has a timestamp is is lower than a previously seen timestamp. For
958*d5c09012SAndroid Build Coastguard Worker    // an example usage see
959*d5c09012SAndroid Build Coastguard Worker    // https://beam.apache.org/documentation/basics/#watermarks
960*d5c09012SAndroid Build Coastguard Worker    google.protobuf.Timestamp estimated_low_watermark = 2;
961*d5c09012SAndroid Build Coastguard Worker  }
962*d5c09012SAndroid Build Coastguard Worker
963*d5c09012SAndroid Build Coastguard Worker  // A message indicating that the client should stop reading from the stream.
964*d5c09012SAndroid Build Coastguard Worker  // If status is OK and `continuation_tokens` & `new_partitions` are empty, the
965*d5c09012SAndroid Build Coastguard Worker  // stream has finished (for example if there was an `end_time` specified).
966*d5c09012SAndroid Build Coastguard Worker  // If `continuation_tokens` & `new_partitions` are present, then a change in
967*d5c09012SAndroid Build Coastguard Worker  // partitioning requires the client to open a new stream for each token to
968*d5c09012SAndroid Build Coastguard Worker  // resume reading. Example:
969*d5c09012SAndroid Build Coastguard Worker  //                                  [B,      D) ends
970*d5c09012SAndroid Build Coastguard Worker  //                                       |
971*d5c09012SAndroid Build Coastguard Worker  //                                       v
972*d5c09012SAndroid Build Coastguard Worker  //               new_partitions:  [A,  C) [C,  E)
973*d5c09012SAndroid Build Coastguard Worker  // continuation_tokens.partitions:  [B,C) [C,D)
974*d5c09012SAndroid Build Coastguard Worker  //                                  ^---^ ^---^
975*d5c09012SAndroid Build Coastguard Worker  //                                  ^     ^
976*d5c09012SAndroid Build Coastguard Worker  //                                  |     |
977*d5c09012SAndroid Build Coastguard Worker  //                                  |     StreamContinuationToken 2
978*d5c09012SAndroid Build Coastguard Worker  //                                  |
979*d5c09012SAndroid Build Coastguard Worker  //                                  StreamContinuationToken 1
980*d5c09012SAndroid Build Coastguard Worker  // To read the new partition [A,C), supply the continuation tokens whose
981*d5c09012SAndroid Build Coastguard Worker  // ranges cover the new partition, for example ContinuationToken[A,B) &
982*d5c09012SAndroid Build Coastguard Worker  // ContinuationToken[B,C).
983*d5c09012SAndroid Build Coastguard Worker  message CloseStream {
984*d5c09012SAndroid Build Coastguard Worker    // The status of the stream.
985*d5c09012SAndroid Build Coastguard Worker    google.rpc.Status status = 1;
986*d5c09012SAndroid Build Coastguard Worker
987*d5c09012SAndroid Build Coastguard Worker    // If non-empty, contains the information needed to resume reading their
988*d5c09012SAndroid Build Coastguard Worker    // associated partitions.
989*d5c09012SAndroid Build Coastguard Worker    repeated StreamContinuationToken continuation_tokens = 2;
990*d5c09012SAndroid Build Coastguard Worker
991*d5c09012SAndroid Build Coastguard Worker    // If non-empty, contains the new partitions to start reading from, which
992*d5c09012SAndroid Build Coastguard Worker    // are related to but not necessarily identical to the partitions for the
993*d5c09012SAndroid Build Coastguard Worker    // above `continuation_tokens`.
994*d5c09012SAndroid Build Coastguard Worker    repeated StreamPartition new_partitions = 3;
995*d5c09012SAndroid Build Coastguard Worker  }
996*d5c09012SAndroid Build Coastguard Worker
997*d5c09012SAndroid Build Coastguard Worker  // The data or control message on the stream.
998*d5c09012SAndroid Build Coastguard Worker  oneof stream_record {
999*d5c09012SAndroid Build Coastguard Worker    // A mutation to the partition.
1000*d5c09012SAndroid Build Coastguard Worker    DataChange data_change = 1;
1001*d5c09012SAndroid Build Coastguard Worker
1002*d5c09012SAndroid Build Coastguard Worker    // A periodic heartbeat message.
1003*d5c09012SAndroid Build Coastguard Worker    Heartbeat heartbeat = 2;
1004*d5c09012SAndroid Build Coastguard Worker
1005*d5c09012SAndroid Build Coastguard Worker    // An indication that the stream should be closed.
1006*d5c09012SAndroid Build Coastguard Worker    CloseStream close_stream = 3;
1007*d5c09012SAndroid Build Coastguard Worker  }
1008*d5c09012SAndroid Build Coastguard Worker}
1009