Skip to content

Commit

Permalink
feat: add ChangeStreamConfig to CreateTable and UpdateTable (googleap…
Browse files Browse the repository at this point in the history
…is#1269)

* feat: publish RateLimitInfo and FeatureFlag protos

PiperOrigin-RevId: 527878708

Source-Link: googleapis/googleapis@f129f48

Source-Link: https://github.com/googleapis/googleapis-gen/commit/e02c87d9d0c9a77f2b17268a86f462b5a1d66bbd
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTAyYzg3ZDlkMGM5YTc3ZjJiMTcyNjhhODZmNDYyYjVhMWQ2NmJiZCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix: Add feature flag proto to BUILD file

PiperOrigin-RevId: 528468347

Source-Link: googleapis/googleapis@38247e8

Source-Link: https://github.com/googleapis/googleapis-gen/commit/17e62a1ab5f22d7d537675a659157207e406e63d
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTdlNjJhMWFiNWYyMmQ3ZDUzNzY3NWE2NTkxNTcyMDdlNDA2ZTYzZCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: add ChangeStreamConfig to CreateTable and UpdateTable

PiperOrigin-RevId: 534836567

Source-Link: googleapis/googleapis@eb2d1f1

Source-Link: https://github.com/googleapis/googleapis-gen/commit/64cebcfc2765bff5afb19c140d4b1600dfdaebad
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjRjZWJjZmMyNzY1YmZmNWFmYjE5YzE0MGQ0YjE2MDBkZmRhZWJhZCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: sofisl <[email protected]>
Co-authored-by: danieljbruce <[email protected]>
  • Loading branch information
4 people authored May 26, 2023
1 parent cf497bd commit 2b05fa4
Show file tree
Hide file tree
Showing 13 changed files with 1,186 additions and 18 deletions.
10 changes: 7 additions & 3 deletions protos/google/bigtable/admin/v2/bigtable_table_admin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -600,11 +600,15 @@ message UpdateTableRequest {
Table table = 1 [(google.api.field_behavior) = REQUIRED];

// Required. The list of fields to update.
// A mask specifying which fields (e.g. `deletion_protection`) in the `table`
// A mask specifying which fields (e.g. `change_stream_config`) in the `table`
// field should be updated. This mask is relative to the `table` field, not to
// the request message. The wildcard (*) path is currently not supported.
// Currently UpdateTable is only supported for the following field:
// * `deletion_protection`
// Currently UpdateTable is only supported for the following fields:
//
// * `change_stream_config`
// * `change_stream_config.retention_period`
// * `deletion_protection`
//
// If `column_families` is set in `update_mask`, it will return an
// UNIMPLEMENTED error.
google.protobuf.FieldMask update_mask = 2
Expand Down
15 changes: 15 additions & 0 deletions protos/google/bigtable/admin/v2/table.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ message RestoreInfo {
}
}

// Change stream configuration.
message ChangeStreamConfig {
// How long the change stream should be retained. Change stream data older
// than the retention period will not be returned when reading the change
// stream from the table.
// Values must be at least 1 day and at most 7 days, and will be truncated to
// microsecond granularity.
google.protobuf.Duration retention_period = 1;
}

// A collection of user data indexed by row, column, and timestamp.
// Each table is served using the resources of its parent cluster.
message Table {
Expand Down Expand Up @@ -157,6 +167,11 @@ message Table {
// field will be populated with information about the restore.
RestoreInfo restore_info = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

// If specified, enable the change stream on this table.
// Otherwise, the change stream is disabled and the change stream is not
// retained.
ChangeStreamConfig change_stream_config = 8;

// Set to true to make the table protected against data loss. i.e. deleting
// the following resources through Admin APIs are prohibited:
// - The table.
Expand Down
34 changes: 30 additions & 4 deletions protos/google/bigtable/v2/bigtable.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -227,7 +227,6 @@ service Bigtable {

// Request message for Bigtable.ReadRows.
message ReadRowsRequest {
//
// The desired view into RequestStats that should be returned in the response.
//
// See also: RequestStats message.
Expand All @@ -254,8 +253,8 @@ message ReadRowsRequest {
}
];

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

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

// One or more results for Entries from the batch request.
repeated Entry entries = 1;

// Information about how client should limit the rate (QPS). Primirily used by
// supported official Cloud Bigtable clients. If unset, the rate limit info is
// not provided by the server.
optional RateLimitInfo rate_limit_info = 3;
}

// Information about how client should adjust the load to Bigtable.
message RateLimitInfo {
// Time that clients should wait before adjusting the target rate again.
// If clients adjust rate too frequently, the impact of the previous
// adjustment may not have been taken into account and may
// over-throttle or under-throttle. If clients adjust rate too slowly, they
// will not be responsive to load changes on server side, and may
// over-throttle or under-throttle.
google.protobuf.Duration period = 1;

// If it has been at least one `period` since the last load adjustment, the
// client should multiply the current load by this value to get the new target
// load. For example, if the current load is 100 and `factor` is 0.8, the new
// target load should be 80. After adjusting, the client should ignore
// `factor` until another `period` has passed.
//
// The client can measure its load using any unit that's comparable over time
// For example, QPS can be used as long as each request involves a similar
// amount of work.
double factor = 2;
}

// Request message for Bigtable.CheckAndMutateRow.
Expand Down
39 changes: 39 additions & 0 deletions protos/google/bigtable/v2/feature_flags.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.bigtable.v2;

option csharp_namespace = "Google.Cloud.Bigtable.V2";
option go_package = "google.golang.org/genproto/googleapis/bigtable/v2;bigtable";
option java_multiple_files = true;
option java_outer_classname = "FeatureFlagsProto";
option java_package = "com.google.bigtable.v2";
option php_namespace = "Google\\Cloud\\Bigtable\\V2";
option ruby_package = "Google::Cloud::Bigtable::V2";

// Feature flags supported by a client.
// This is intended to be sent as part of request metadata to assure the server
// that certain behaviors are safe to enable. This proto is meant to be
// serialized and websafe-base64 encoded under the `bigtable-features` metadata
// key. The value will remain constant for the lifetime of a client and due to
// HTTP2's HPACK compression, the request overhead will be tiny.
// This is an internal implementation detail and should not be used by endusers
// directly.
message FeatureFlags {
// Notify the server that the client enables batch write flow control by
// requesting RateLimitInfo from MutateRowsResponse.
bool mutate_rows_rate_limit = 3;
}
Loading

0 comments on commit 2b05fa4

Please sign in to comment.