Skip to content

Commit f129f48

Browse files
Google APIscopybara-github
authored andcommitted
feat: publish RateLimitInfo and FeatureFlag protos
PiperOrigin-RevId: 527878708
1 parent 73d1679 commit f129f48

3 files changed

Lines changed: 70 additions & 4 deletions

File tree

google/bigtable/v2/bigtable.proto

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 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.
@@ -227,7 +227,6 @@ service Bigtable {
227227

228228
// Request message for Bigtable.ReadRows.
229229
message ReadRowsRequest {
230-
//
231230
// The desired view into RequestStats that should be returned in the response.
232231
//
233232
// See also: RequestStats message.
@@ -254,8 +253,8 @@ message ReadRowsRequest {
254253
}
255254
];
256255

257-
// This value specifies routing for replication. This API only accepts the
258-
// empty value of app_profile_id.
256+
// This value specifies routing for replication. If not specified, the
257+
// "default" application profile will be used.
259258
string app_profile_id = 5;
260259

261260
// The row keys and/or ranges to read sequentially. If not specified, reads
@@ -489,6 +488,33 @@ message MutateRowsResponse {
489488

490489
// One or more results for Entries from the batch request.
491490
repeated Entry entries = 1;
491+
492+
// Information about how client should limit the rate (QPS). Primirily used by
493+
// supported official Cloud Bigtable clients. If unset, the rate limit info is
494+
// not provided by the server.
495+
optional RateLimitInfo rate_limit_info = 3;
496+
}
497+
498+
// Information about how client should adjust the load to Bigtable.
499+
message RateLimitInfo {
500+
// Time that clients should wait before adjusting the target rate again.
501+
// If clients adjust rate too frequently, the impact of the previous
502+
// adjustment may not have been taken into account and may
503+
// over-throttle or under-throttle. If clients adjust rate too slowly, they
504+
// will not be responsive to load changes on server side, and may
505+
// over-throttle or under-throttle.
506+
google.protobuf.Duration period = 1;
507+
508+
// If it has been at least one `period` since the last load adjustment, the
509+
// client should multiply the current load by this value to get the new target
510+
// load. For example, if the current load is 100 and `factor` is 0.8, the new
511+
// target load should be 80. After adjusting, the client should ignore
512+
// `factor` until another `period` has passed.
513+
//
514+
// The client can measure its load using any unit that's comparable over time
515+
// For example, QPS can be used as long as each request involves a similar
516+
// amount of work.
517+
double factor = 2;
492518
}
493519

494520
// Request message for Bigtable.CheckAndMutateRow.

google/bigtable/v2/bigtable_v2.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ apis:
77
- name: google.bigtable.v2.Bigtable
88

99
types:
10+
- name: google.bigtable.v2.FeatureFlags
1011
- name: google.bigtable.v2.RequestStats
1112
- name: google.bigtable.v2.ResponseParams
1213

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Copyright 2023 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package google.bigtable.v2;
18+
19+
option csharp_namespace = "Google.Cloud.Bigtable.V2";
20+
option go_package = "google.golang.org/genproto/googleapis/bigtable/v2;bigtable";
21+
option java_multiple_files = true;
22+
option java_outer_classname = "FeatureFlagsProto";
23+
option java_package = "com.google.bigtable.v2";
24+
option php_namespace = "Google\\Cloud\\Bigtable\\V2";
25+
option ruby_package = "Google::Cloud::Bigtable::V2";
26+
27+
// Feature flags supported by a client.
28+
// This is intended to be sent as part of request metadata to assure the server
29+
// that certain behaviors are safe to enable. This proto is meant to be
30+
// serialized and websafe-base64 encoded under the `bigtable-features` metadata
31+
// key. The value will remain constant for the lifetime of a client and due to
32+
// HTTP2's HPACK compression, the request overhead will be tiny.
33+
// This is an internal implementation detail and should not be used by endusers
34+
// directly.
35+
message FeatureFlags {
36+
// Notify the server that the client enables batch write flow control by
37+
// requesting RateLimitInfo from MutateRowsResponse.
38+
bool mutate_rows_rate_limit = 3;
39+
}

0 commit comments

Comments
 (0)