@@ -22,6 +22,7 @@ import "google/api/field_behavior.proto";
2222import "google/api/resource.proto" ;
2323import "google/api/routing.proto" ;
2424import "google/bigtable/v2/data.proto" ;
25+ import "google/bigtable/v2/request_stats.proto" ;
2526import "google/protobuf/wrappers.proto" ;
2627import "google/rpc/status.proto" ;
2728
@@ -32,14 +33,14 @@ option java_outer_classname = "BigtableProto";
3233option java_package = "com.google.bigtable.v2" ;
3334option php_namespace = "Google\\Cloud\\Bigtable\\V2" ;
3435option ruby_package = "Google::Cloud::Bigtable::V2" ;
35- option (google.api.resource_definition ) = {
36- type : "bigtableadmin.googleapis.com/Table"
37- pattern : "projects/{project}/instances/{instance}/tables/{table}"
38- };
3936option (google.api.resource_definition ) = {
4037 type : "bigtableadmin.googleapis.com/Instance"
4138 pattern : "projects/{project}/instances/{instance}"
4239};
40+ option (google.api.resource_definition ) = {
41+ type : "bigtableadmin.googleapis.com/Table"
42+ pattern : "projects/{project}/instances/{instance}/tables/{table}"
43+ };
4344
4445// Service for reading from and writing to existing Bigtable tables.
4546service Bigtable {
@@ -67,9 +68,7 @@ service Bigtable {
6768 field : "table_name"
6869 path_template : "{table_name=projects/*/instances/*/tables/*}"
6970 }
70- routing_parameters {
71- field : "app_profile_id"
72- }
71+ routing_parameters { field : "app_profile_id" }
7372 };
7473 option (google.api.method_signature ) = "table_name" ;
7574 option (google.api.method_signature ) = "table_name,app_profile_id" ;
@@ -79,7 +78,8 @@ service Bigtable {
7978 // delimit contiguous sections of the table of approximately equal size,
8079 // which can be used to break up the data for distributed tasks like
8180 // mapreduces.
82- rpc SampleRowKeys (SampleRowKeysRequest ) returns (stream SampleRowKeysResponse ) {
81+ rpc SampleRowKeys (SampleRowKeysRequest )
82+ returns (stream SampleRowKeysResponse ) {
8383 option (google.api.http ) = {
8484 get : "/v2/{table_name=projects/*/instances/*/tables/*}:sampleRowKeys"
8585 };
@@ -88,9 +88,7 @@ service Bigtable {
8888 field : "table_name"
8989 path_template : "{table_name=projects/*/instances/*/tables/*}"
9090 }
91- routing_parameters {
92- field : "app_profile_id"
93- }
91+ routing_parameters { field : "app_profile_id" }
9492 };
9593 option (google.api.method_signature ) = "table_name" ;
9694 option (google.api.method_signature ) = "table_name,app_profile_id" ;
@@ -108,12 +106,11 @@ service Bigtable {
108106 field : "table_name"
109107 path_template : "{table_name=projects/*/instances/*/tables/*}"
110108 }
111- routing_parameters {
112- field : "app_profile_id"
113- }
109+ routing_parameters { field : "app_profile_id" }
114110 };
115111 option (google.api.method_signature ) = "table_name,row_key,mutations" ;
116- option (google.api.method_signature ) = "table_name,row_key,mutations,app_profile_id" ;
112+ option (google.api.method_signature ) =
113+ "table_name,row_key,mutations,app_profile_id" ;
117114 }
118115
119116 // Mutates multiple rows in a batch. Each individual row is mutated
@@ -129,16 +126,15 @@ service Bigtable {
129126 field : "table_name"
130127 path_template : "{table_name=projects/*/instances/*/tables/*}"
131128 }
132- routing_parameters {
133- field : "app_profile_id"
134- }
129+ routing_parameters { field : "app_profile_id" }
135130 };
136131 option (google.api.method_signature ) = "table_name,entries" ;
137132 option (google.api.method_signature ) = "table_name,entries,app_profile_id" ;
138133 }
139134
140135 // Mutates a row atomically based on the output of a predicate Reader filter.
141- rpc CheckAndMutateRow (CheckAndMutateRowRequest ) returns (CheckAndMutateRowResponse ) {
136+ rpc CheckAndMutateRow (CheckAndMutateRowRequest )
137+ returns (CheckAndMutateRowResponse ) {
142138 option (google.api.http ) = {
143139 post : "/v2/{table_name=projects/*/instances/*/tables/*}:checkAndMutateRow"
144140 body : "*"
@@ -148,12 +144,12 @@ service Bigtable {
148144 field : "table_name"
149145 path_template : "{table_name=projects/*/instances/*/tables/*}"
150146 }
151- routing_parameters {
152- field : "app_profile_id"
153- }
147+ routing_parameters { field : "app_profile_id" }
154148 };
155- option (google.api.method_signature ) = "table_name,row_key,predicate_filter,true_mutations,false_mutations" ;
156- option (google.api.method_signature ) = "table_name,row_key,predicate_filter,true_mutations,false_mutations,app_profile_id" ;
149+ option (google.api.method_signature ) =
150+ "table_name,row_key,predicate_filter,true_mutations,false_mutations" ;
151+ option (google.api.method_signature ) =
152+ "table_name,row_key,predicate_filter,true_mutations,false_mutations,app_profile_id" ;
157153 }
158154
159155 // Warm up associated instance metadata for this connection.
@@ -168,9 +164,7 @@ service Bigtable {
168164 field : "name"
169165 path_template : "{name=projects/*/instances/*}"
170166 }
171- routing_parameters {
172- field : "app_profile_id"
173- }
167+ routing_parameters { field : "app_profile_id" }
174168 };
175169 option (google.api.method_signature ) = "name" ;
176170 option (google.api.method_signature ) = "name,app_profile_id" ;
@@ -181,7 +175,8 @@ service Bigtable {
181175 // entry based on pre-defined read/modify/write rules. The new value for the
182176 // timestamp is the greater of the existing timestamp or the current server
183177 // time. The method returns the new contents of all modified cells.
184- rpc ReadModifyWriteRow (ReadModifyWriteRowRequest ) returns (ReadModifyWriteRowResponse ) {
178+ rpc ReadModifyWriteRow (ReadModifyWriteRowRequest )
179+ returns (ReadModifyWriteRowResponse ) {
185180 option (google.api.http ) = {
186181 post : "/v2/{table_name=projects/*/instances/*/tables/*}:readModifyWriteRow"
187182 body : "*"
@@ -191,17 +186,36 @@ service Bigtable {
191186 field : "table_name"
192187 path_template : "{table_name=projects/*/instances/*/tables/*}"
193188 }
194- routing_parameters {
195- field : "app_profile_id"
196- }
189+ routing_parameters { field : "app_profile_id" }
197190 };
198191 option (google.api.method_signature ) = "table_name,row_key,rules" ;
199- option (google.api.method_signature ) = "table_name,row_key,rules,app_profile_id" ;
192+ option (google.api.method_signature ) =
193+ "table_name,row_key,rules,app_profile_id" ;
200194 }
201195}
202196
203197// Request message for Bigtable.ReadRows.
204198message ReadRowsRequest {
199+ //
200+ // The desired view into RequestStats that should be returned in the response.
201+ //
202+ // See also: RequestStats message.
203+ enum RequestStatsView {
204+ // The default / unset value. The API will default to the NONE option below.
205+ REQUEST_STATS_VIEW_UNSPECIFIED = 0 ;
206+
207+ // Do not include any RequestStats in the response. This will leave the
208+ // RequestStats embedded message unset in the response.
209+ REQUEST_STATS_NONE = 1 ;
210+
211+ // Include stats related to the efficiency of the read.
212+ REQUEST_STATS_EFFICIENCY = 2 ;
213+
214+ // Include the full set of available RequestStats in the response,
215+ // applicable to this read.
216+ REQUEST_STATS_FULL = 3 ;
217+ }
218+
205219 // Required. The unique name of the table from which to read.
206220 // Values are of the form
207221 // `projects/<project>/instances/<instance>/tables/<table>`.
@@ -212,8 +226,8 @@ message ReadRowsRequest {
212226 }
213227 ];
214228
215- // This value specifies routing for replication. If not specified, the
216- // "default" application profile will be used .
229+ // This value specifies routing for replication. This API only accepts the
230+ // empty value of app_profile_id .
217231 string app_profile_id = 5 ;
218232
219233 // The row keys and/or ranges to read sequentially. If not specified, reads
@@ -227,6 +241,9 @@ message ReadRowsRequest {
227241 // The read will stop after committing to N rows' worth of results. The
228242 // default (zero) is to return all results.
229243 int64 rows_limit = 4 ;
244+
245+ // The view into RequestStats, as described above.
246+ RequestStatsView request_stats_view = 6 ;
230247}
231248
232249// Response message for Bigtable.ReadRows.
@@ -306,6 +323,28 @@ message ReadRowsResponse {
306323 // lot of data that was filtered out since the last committed row
307324 // key, allowing the client to skip that work on a retry.
308325 bytes last_scanned_row_key = 2 ;
326+
327+ //
328+ // If requested, provide enhanced query performance statistics. The semantics
329+ // dictate:
330+ // * request_stats is empty on every (streamed) response, except
331+ // * request_stats has non-empty information after all chunks have been
332+ // streamed, where the ReadRowsResponse message only contains
333+ // request_stats.
334+ // * For example, if a read request would have returned an empty
335+ // response instead a single ReadRowsResponse is streamed with empty
336+ // chunks and request_stats filled.
337+ //
338+ // Visually, response messages will stream as follows:
339+ // ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
340+ // \______________________/ \________________________________/
341+ // Primary response Trailer of RequestStats info
342+ //
343+ // Or if the read did not return any values:
344+ // {chunks: [], request_stats: {...}}
345+ // \________________________________/
346+ // Trailer of RequestStats info
347+ RequestStats request_stats = 3 ;
309348}
310349
311350// Request message for Bigtable.SampleRowKeys.
@@ -345,8 +384,8 @@ message SampleRowKeysResponse {
345384
346385// Request message for Bigtable.MutateRow.
347386message MutateRowRequest {
348- // Required. The unique name of the table to which the mutation should be applied.
349- // Values are of the form
387+ // Required. The unique name of the table to which the mutation should be
388+ // applied. Values are of the form
350389 // `projects/<project>/instances/<instance>/tables/<table>`.
351390 string table_name = 1 [
352391 (google.api.field_behavior ) = REQUIRED ,
@@ -362,16 +401,14 @@ message MutateRowRequest {
362401 // Required. The key of the row to which the mutation should be applied.
363402 bytes row_key = 2 [(google.api.field_behavior ) = REQUIRED ];
364403
365- // Required. Changes to be atomically applied to the specified row. Entries are applied
366- // in order, meaning that earlier mutations can be masked by later ones.
367- // Must contain at least one entry and at most 100000.
404+ // Required. Changes to be atomically applied to the specified row. Entries
405+ // are applied in order, meaning that earlier mutations can be masked by later
406+ // ones. Must contain at least one entry and at most 100000.
368407 repeated Mutation mutations = 3 [(google.api.field_behavior ) = REQUIRED ];
369408}
370409
371410// Response message for Bigtable.MutateRow.
372- message MutateRowResponse {
373-
374- }
411+ message MutateRowResponse {}
375412
376413// Request message for BigtableService.MutateRows.
377414message MutateRowsRequest {
@@ -380,14 +417,14 @@ message MutateRowsRequest {
380417 // The key of the row to which the `mutations` should be applied.
381418 bytes row_key = 1 ;
382419
383- // Required. Changes to be atomically applied to the specified row. Mutations are
384- // applied in order, meaning that earlier mutations can be masked by
385- // later ones.
386- // You must specify at least one mutation.
420+ // Required. Changes to be atomically applied to the specified row.
421+ // Mutations are applied in order, meaning that earlier mutations can be
422+ // masked by later ones. You must specify at least one mutation.
387423 repeated Mutation mutations = 2 [(google.api.field_behavior ) = REQUIRED ];
388424 }
389425
390- // Required. The unique name of the table to which the mutations should be applied.
426+ // Required. The unique name of the table to which the mutations should be
427+ // applied.
391428 string table_name = 1 [
392429 (google.api.field_behavior ) = REQUIRED ,
393430 (google.api.resource_reference ) = {
@@ -428,9 +465,8 @@ message MutateRowsResponse {
428465
429466// Request message for Bigtable.CheckAndMutateRow.
430467message CheckAndMutateRowRequest {
431- // Required. The unique name of the table to which the conditional mutation should be
432- // applied.
433- // Values are of the form
468+ // Required. The unique name of the table to which the conditional mutation
469+ // should be applied. Values are of the form
434470 // `projects/<project>/instances/<instance>/tables/<table>`.
435471 string table_name = 1 [
436472 (google.api.field_behavior ) = REQUIRED ,
@@ -443,7 +479,8 @@ message CheckAndMutateRowRequest {
443479 // "default" application profile will be used.
444480 string app_profile_id = 7 ;
445481
446- // Required. The key of the row to which the conditional mutation should be applied.
482+ // Required. The key of the row to which the conditional mutation should be
483+ // applied.
447484 bytes row_key = 2 [(google.api.field_behavior ) = REQUIRED ];
448485
449486 // The filter to be applied to the contents of the specified row. Depending
@@ -476,8 +513,9 @@ message CheckAndMutateRowResponse {
476513
477514// Request message for client connection keep-alive and warming.
478515message PingAndWarmRequest {
479- // Required. The unique name of the instance to check permissions for as well as
480- // respond. Values are of the form `projects/<project>/instances/<instance>`.
516+ // Required. The unique name of the instance to check permissions for as well
517+ // as respond. Values are of the form
518+ // `projects/<project>/instances/<instance>`.
481519 string name = 1 [
482520 (google.api.field_behavior ) = REQUIRED ,
483521 (google.api.resource_reference ) = {
@@ -491,15 +529,12 @@ message PingAndWarmRequest {
491529}
492530
493531// Response message for Bigtable.PingAndWarm connection keepalive and warming.
494- message PingAndWarmResponse {
495-
496- }
532+ message PingAndWarmResponse {}
497533
498534// Request message for Bigtable.ReadModifyWriteRow.
499535message ReadModifyWriteRowRequest {
500- // Required. The unique name of the table to which the read/modify/write rules should be
501- // applied.
502- // Values are of the form
536+ // Required. The unique name of the table to which the read/modify/write rules
537+ // should be applied. Values are of the form
503538 // `projects/<project>/instances/<instance>/tables/<table>`.
504539 string table_name = 1 [
505540 (google.api.field_behavior ) = REQUIRED ,
@@ -512,13 +547,15 @@ message ReadModifyWriteRowRequest {
512547 // "default" application profile will be used.
513548 string app_profile_id = 4 ;
514549
515- // Required. The key of the row to which the read/modify/write rules should be applied.
550+ // Required. The key of the row to which the read/modify/write rules should be
551+ // applied.
516552 bytes row_key = 2 [(google.api.field_behavior ) = REQUIRED ];
517553
518- // Required. Rules specifying how the specified row's contents are to be transformed
519- // into writes. Entries are applied in order, meaning that earlier rules will
520- // affect the results of later ones.
521- repeated ReadModifyWriteRule rules = 3 [(google.api.field_behavior ) = REQUIRED ];
554+ // Required. Rules specifying how the specified row's contents are to be
555+ // transformed into writes. Entries are applied in order, meaning that earlier
556+ // rules will affect the results of later ones.
557+ repeated ReadModifyWriteRule rules = 3
558+ [(google.api.field_behavior ) = REQUIRED ];
522559}
523560
524561// Response message for Bigtable.ReadModifyWriteRow.
0 commit comments