Skip to content

Commit d7ee523

Browse files
Google APIscopybara-github
authored andcommitted
feat: add explicit routing header annotations for bigtable/v2
feat: add `routing_proto` to the Bazel dependencies for bigtable/v2 Committer: @viacheslav-rostovtsev PiperOrigin-RevId: 423158199
1 parent 6f4ad75 commit d7ee523

3 files changed

Lines changed: 62 additions & 6 deletions

File tree

google/bigtable/v2/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ proto_library(
2020
"//google/api:client_proto",
2121
"//google/api:field_behavior_proto",
2222
"//google/api:resource_proto",
23+
"//google/api:routing_proto",
2324
"//google/rpc:status_proto",
2425
"@com_google_protobuf//:wrappers_proto",
2526
],

google/bigtable/v2/bigtable.proto

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Google LLC.
1+
// Copyright 2019 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ import "google/api/annotations.proto";
2020
import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
2222
import "google/api/resource.proto";
23+
import "google/api/routing.proto";
2324
import "google/bigtable/v2/data.proto";
2425
import "google/protobuf/wrappers.proto";
2526
import "google/rpc/status.proto";
@@ -57,6 +58,15 @@ service Bigtable {
5758
post: "/v2/{table_name=projects/*/instances/*/tables/*}:readRows"
5859
body: "*"
5960
};
61+
option (google.api.routing) = {
62+
routing_parameters {
63+
field: "table_name"
64+
path_template: "{table_name=projects/*/instances/*/tables/*}"
65+
}
66+
routing_parameters {
67+
field: "app_profile_id"
68+
}
69+
};
6070
option (google.api.method_signature) = "table_name";
6171
option (google.api.method_signature) = "table_name,app_profile_id";
6272
}
@@ -69,6 +79,15 @@ service Bigtable {
6979
option (google.api.http) = {
7080
get: "/v2/{table_name=projects/*/instances/*/tables/*}:sampleRowKeys"
7181
};
82+
option (google.api.routing) = {
83+
routing_parameters {
84+
field: "table_name"
85+
path_template: "{table_name=projects/*/instances/*/tables/*}"
86+
}
87+
routing_parameters {
88+
field: "app_profile_id"
89+
}
90+
};
7291
option (google.api.method_signature) = "table_name";
7392
option (google.api.method_signature) = "table_name,app_profile_id";
7493
}
@@ -80,6 +99,15 @@ service Bigtable {
8099
post: "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRow"
81100
body: "*"
82101
};
102+
option (google.api.routing) = {
103+
routing_parameters {
104+
field: "table_name"
105+
path_template: "{table_name=projects/*/instances/*/tables/*}"
106+
}
107+
routing_parameters {
108+
field: "app_profile_id"
109+
}
110+
};
83111
option (google.api.method_signature) = "table_name,row_key,mutations";
84112
option (google.api.method_signature) = "table_name,row_key,mutations,app_profile_id";
85113
}
@@ -92,6 +120,15 @@ service Bigtable {
92120
post: "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRows"
93121
body: "*"
94122
};
123+
option (google.api.routing) = {
124+
routing_parameters {
125+
field: "table_name"
126+
path_template: "{table_name=projects/*/instances/*/tables/*}"
127+
}
128+
routing_parameters {
129+
field: "app_profile_id"
130+
}
131+
};
95132
option (google.api.method_signature) = "table_name,entries";
96133
option (google.api.method_signature) = "table_name,entries,app_profile_id";
97134
}
@@ -102,6 +139,15 @@ service Bigtable {
102139
post: "/v2/{table_name=projects/*/instances/*/tables/*}:checkAndMutateRow"
103140
body: "*"
104141
};
142+
option (google.api.routing) = {
143+
routing_parameters {
144+
field: "table_name"
145+
path_template: "{table_name=projects/*/instances/*/tables/*}"
146+
}
147+
routing_parameters {
148+
field: "app_profile_id"
149+
}
150+
};
105151
option (google.api.method_signature) = "table_name,row_key,predicate_filter,true_mutations,false_mutations";
106152
option (google.api.method_signature) = "table_name,row_key,predicate_filter,true_mutations,false_mutations,app_profile_id";
107153
}
@@ -116,6 +162,15 @@ service Bigtable {
116162
post: "/v2/{table_name=projects/*/instances/*/tables/*}:readModifyWriteRow"
117163
body: "*"
118164
};
165+
option (google.api.routing) = {
166+
routing_parameters {
167+
field: "table_name"
168+
path_template: "{table_name=projects/*/instances/*/tables/*}"
169+
}
170+
routing_parameters {
171+
field: "app_profile_id"
172+
}
173+
};
119174
option (google.api.method_signature) = "table_name,row_key,rules";
120175
option (google.api.method_signature) = "table_name,row_key,rules,app_profile_id";
121176
}
@@ -137,14 +192,15 @@ message ReadRowsRequest {
137192
// "default" application profile will be used.
138193
string app_profile_id = 5;
139194

140-
// The row keys and/or ranges to read. If not specified, reads from all rows.
195+
// The row keys and/or ranges to read sequentially. If not specified, reads
196+
// from all rows.
141197
RowSet rows = 2;
142198

143199
// The filter to apply to the contents of the specified row(s). If unset,
144200
// reads the entirety of each row.
145201
RowFilter filter = 3;
146202

147-
// The read will terminate after committing to N rows' worth of results. The
203+
// The read will stop after committing to N rows' worth of results. The
148204
// default (zero) is to return all results.
149205
int64 rows_limit = 4;
150206
}

google/bigtable/v2/data.proto

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Google LLC.
1+
// Copyright 2019 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -11,7 +11,6 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-
//
1514

1615
syntax = "proto3";
1716

@@ -210,7 +209,7 @@ message ValueRange {
210209
// RowFilter.Chain and RowFilter.Interleave documentation.
211210
//
212211
// The total serialized size of a RowFilter message must not
213-
// exceed 4096 bytes, and RowFilters may not be nested within each other
212+
// exceed 20480 bytes, and RowFilters may not be nested within each other
214213
// (in Chains or Interleaves) to a depth of more than 20.
215214
message RowFilter {
216215
// A RowFilter which sends rows through several RowFilters in sequence.

0 commit comments

Comments
 (0)