Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: publish the RequestStats proto #1177

Merged
merged 3 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 101 additions & 64 deletions protos/google/bigtable/v2/bigtable.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/api/routing.proto";
import "google/bigtable/v2/data.proto";
import "google/bigtable/v2/request_stats.proto";
import "google/protobuf/wrappers.proto";
import "google/rpc/status.proto";

Expand All @@ -32,14 +33,14 @@ option java_outer_classname = "BigtableProto";
option java_package = "com.google.bigtable.v2";
option php_namespace = "Google\\Cloud\\Bigtable\\V2";
option ruby_package = "Google::Cloud::Bigtable::V2";
option (google.api.resource_definition) = {
type: "bigtableadmin.googleapis.com/Table"
pattern: "projects/{project}/instances/{instance}/tables/{table}"
};
option (google.api.resource_definition) = {
type: "bigtableadmin.googleapis.com/Instance"
pattern: "projects/{project}/instances/{instance}"
};
option (google.api.resource_definition) = {
type: "bigtableadmin.googleapis.com/Table"
pattern: "projects/{project}/instances/{instance}/tables/{table}"
};

// Service for reading from and writing to existing Bigtable tables.
service Bigtable {
Expand Down Expand Up @@ -67,9 +68,7 @@ service Bigtable {
field: "table_name"
path_template: "{table_name=projects/*/instances/*/tables/*}"
}
routing_parameters {
field: "app_profile_id"
}
routing_parameters { field: "app_profile_id" }
};
option (google.api.method_signature) = "table_name";
option (google.api.method_signature) = "table_name,app_profile_id";
Expand All @@ -79,7 +78,8 @@ service Bigtable {
// delimit contiguous sections of the table of approximately equal size,
// which can be used to break up the data for distributed tasks like
// mapreduces.
rpc SampleRowKeys(SampleRowKeysRequest) returns (stream SampleRowKeysResponse) {
rpc SampleRowKeys(SampleRowKeysRequest)
returns (stream SampleRowKeysResponse) {
option (google.api.http) = {
get: "/v2/{table_name=projects/*/instances/*/tables/*}:sampleRowKeys"
};
Expand All @@ -88,9 +88,7 @@ service Bigtable {
field: "table_name"
path_template: "{table_name=projects/*/instances/*/tables/*}"
}
routing_parameters {
field: "app_profile_id"
}
routing_parameters { field: "app_profile_id" }
};
option (google.api.method_signature) = "table_name";
option (google.api.method_signature) = "table_name,app_profile_id";
Expand All @@ -108,12 +106,11 @@ service Bigtable {
field: "table_name"
path_template: "{table_name=projects/*/instances/*/tables/*}"
}
routing_parameters {
field: "app_profile_id"
}
routing_parameters { field: "app_profile_id" }
};
option (google.api.method_signature) = "table_name,row_key,mutations";
option (google.api.method_signature) = "table_name,row_key,mutations,app_profile_id";
option (google.api.method_signature) =
"table_name,row_key,mutations,app_profile_id";
}

// Mutates multiple rows in a batch. Each individual row is mutated
Expand All @@ -129,16 +126,15 @@ service Bigtable {
field: "table_name"
path_template: "{table_name=projects/*/instances/*/tables/*}"
}
routing_parameters {
field: "app_profile_id"
}
routing_parameters { field: "app_profile_id" }
};
option (google.api.method_signature) = "table_name,entries";
option (google.api.method_signature) = "table_name,entries,app_profile_id";
}

// Mutates a row atomically based on the output of a predicate Reader filter.
rpc CheckAndMutateRow(CheckAndMutateRowRequest) returns (CheckAndMutateRowResponse) {
rpc CheckAndMutateRow(CheckAndMutateRowRequest)
returns (CheckAndMutateRowResponse) {
option (google.api.http) = {
post: "/v2/{table_name=projects/*/instances/*/tables/*}:checkAndMutateRow"
body: "*"
Expand All @@ -148,12 +144,12 @@ service Bigtable {
field: "table_name"
path_template: "{table_name=projects/*/instances/*/tables/*}"
}
routing_parameters {
field: "app_profile_id"
}
routing_parameters { field: "app_profile_id" }
};
option (google.api.method_signature) = "table_name,row_key,predicate_filter,true_mutations,false_mutations";
option (google.api.method_signature) = "table_name,row_key,predicate_filter,true_mutations,false_mutations,app_profile_id";
option (google.api.method_signature) =
"table_name,row_key,predicate_filter,true_mutations,false_mutations";
option (google.api.method_signature) =
"table_name,row_key,predicate_filter,true_mutations,false_mutations,app_profile_id";
}

// Warm up associated instance metadata for this connection.
Expand All @@ -168,9 +164,7 @@ service Bigtable {
field: "name"
path_template: "{name=projects/*/instances/*}"
}
routing_parameters {
field: "app_profile_id"
}
routing_parameters { field: "app_profile_id" }
};
option (google.api.method_signature) = "name";
option (google.api.method_signature) = "name,app_profile_id";
Expand All @@ -181,7 +175,8 @@ service Bigtable {
// entry based on pre-defined read/modify/write rules. The new value for the
// timestamp is the greater of the existing timestamp or the current server
// time. The method returns the new contents of all modified cells.
rpc ReadModifyWriteRow(ReadModifyWriteRowRequest) returns (ReadModifyWriteRowResponse) {
rpc ReadModifyWriteRow(ReadModifyWriteRowRequest)
returns (ReadModifyWriteRowResponse) {
option (google.api.http) = {
post: "/v2/{table_name=projects/*/instances/*/tables/*}:readModifyWriteRow"
body: "*"
Expand All @@ -191,17 +186,36 @@ service Bigtable {
field: "table_name"
path_template: "{table_name=projects/*/instances/*/tables/*}"
}
routing_parameters {
field: "app_profile_id"
}
routing_parameters { field: "app_profile_id" }
};
option (google.api.method_signature) = "table_name,row_key,rules";
option (google.api.method_signature) = "table_name,row_key,rules,app_profile_id";
option (google.api.method_signature) =
"table_name,row_key,rules,app_profile_id";
}
}

// Request message for Bigtable.ReadRows.
message ReadRowsRequest {
//
// The desired view into RequestStats that should be returned in the response.
//
// See also: RequestStats message.
enum RequestStatsView {
// The default / unset value. The API will default to the NONE option below.
REQUEST_STATS_VIEW_UNSPECIFIED = 0;

// Do not include any RequestStats in the response. This will leave the
// RequestStats embedded message unset in the response.
REQUEST_STATS_NONE = 1;

// Include stats related to the efficiency of the read.
REQUEST_STATS_EFFICIENCY = 2;

// Include the full set of available RequestStats in the response,
// applicable to this read.
REQUEST_STATS_FULL = 3;
}

// Required. The unique name of the table from which to read.
// Values are of the form
// `projects/<project>/instances/<instance>/tables/<table>`.
Expand All @@ -212,8 +226,8 @@ message ReadRowsRequest {
}
];

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

// The row keys and/or ranges to read sequentially. If not specified, reads
Expand All @@ -227,6 +241,9 @@ message ReadRowsRequest {
// The read will stop after committing to N rows' worth of results. The
// default (zero) is to return all results.
int64 rows_limit = 4;

// The view into RequestStats, as described above.
RequestStatsView request_stats_view = 6;
}

// Response message for Bigtable.ReadRows.
Expand Down Expand Up @@ -306,6 +323,28 @@ message ReadRowsResponse {
// lot of data that was filtered out since the last committed row
// key, allowing the client to skip that work on a retry.
bytes last_scanned_row_key = 2;

//
// If requested, provide enhanced query performance statistics. The semantics
// dictate:
// * request_stats is empty on every (streamed) response, except
// * request_stats has non-empty information after all chunks have been
// streamed, where the ReadRowsResponse message only contains
// request_stats.
// * For example, if a read request would have returned an empty
// response instead a single ReadRowsResponse is streamed with empty
// chunks and request_stats filled.
//
// Visually, response messages will stream as follows:
// ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
// \______________________/ \________________________________/
// Primary response Trailer of RequestStats info
//
// Or if the read did not return any values:
// {chunks: [], request_stats: {...}}
// \________________________________/
// Trailer of RequestStats info
RequestStats request_stats = 3;
}

// Request message for Bigtable.SampleRowKeys.
Expand Down Expand Up @@ -345,8 +384,8 @@ message SampleRowKeysResponse {

// Request message for Bigtable.MutateRow.
message MutateRowRequest {
// Required. The unique name of the table to which the mutation should be applied.
// Values are of the form
// Required. The unique name of the table to which the mutation should be
// applied. Values are of the form
// `projects/<project>/instances/<instance>/tables/<table>`.
string table_name = 1 [
(google.api.field_behavior) = REQUIRED,
Expand All @@ -362,16 +401,14 @@ message MutateRowRequest {
// Required. The key of the row to which the mutation should be applied.
bytes row_key = 2 [(google.api.field_behavior) = REQUIRED];

// Required. Changes to be atomically applied to the specified row. Entries are applied
// in order, meaning that earlier mutations can be masked by later ones.
// Must contain at least one entry and at most 100000.
// Required. Changes to be atomically applied to the specified row. Entries
// are applied in order, meaning that earlier mutations can be masked by later
// ones. Must contain at least one entry and at most 100000.
repeated Mutation mutations = 3 [(google.api.field_behavior) = REQUIRED];
}

// Response message for Bigtable.MutateRow.
message MutateRowResponse {

}
message MutateRowResponse {}

// Request message for BigtableService.MutateRows.
message MutateRowsRequest {
Expand All @@ -380,14 +417,14 @@ message MutateRowsRequest {
// The key of the row to which the `mutations` should be applied.
bytes row_key = 1;

// Required. Changes to be atomically applied to the specified row. Mutations are
// applied in order, meaning that earlier mutations can be masked by
// later ones.
// You must specify at least one mutation.
// Required. Changes to be atomically applied to the specified row.
// Mutations are applied in order, meaning that earlier mutations can be
// masked by later ones. You must specify at least one mutation.
repeated Mutation mutations = 2 [(google.api.field_behavior) = REQUIRED];
}

// Required. The unique name of the table to which the mutations should be applied.
// Required. The unique name of the table to which the mutations should be
// applied.
string table_name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand Down Expand Up @@ -428,9 +465,8 @@ message MutateRowsResponse {

// Request message for Bigtable.CheckAndMutateRow.
message CheckAndMutateRowRequest {
// Required. The unique name of the table to which the conditional mutation should be
// applied.
// Values are of the form
// Required. The unique name of the table to which the conditional mutation
// should be applied. Values are of the form
// `projects/<project>/instances/<instance>/tables/<table>`.
string table_name = 1 [
(google.api.field_behavior) = REQUIRED,
Expand All @@ -443,7 +479,8 @@ message CheckAndMutateRowRequest {
// "default" application profile will be used.
string app_profile_id = 7;

// Required. The key of the row to which the conditional mutation should be applied.
// Required. The key of the row to which the conditional mutation should be
// applied.
bytes row_key = 2 [(google.api.field_behavior) = REQUIRED];

// The filter to be applied to the contents of the specified row. Depending
Expand Down Expand Up @@ -476,8 +513,9 @@ message CheckAndMutateRowResponse {

// Request message for client connection keep-alive and warming.
message PingAndWarmRequest {
// Required. The unique name of the instance to check permissions for as well as
// respond. Values are of the form `projects/<project>/instances/<instance>`.
// Required. The unique name of the instance to check permissions for as well
// as respond. Values are of the form
// `projects/<project>/instances/<instance>`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand All @@ -491,15 +529,12 @@ message PingAndWarmRequest {
}

// Response message for Bigtable.PingAndWarm connection keepalive and warming.
message PingAndWarmResponse {

}
message PingAndWarmResponse {}

// Request message for Bigtable.ReadModifyWriteRow.
message ReadModifyWriteRowRequest {
// Required. The unique name of the table to which the read/modify/write rules should be
// applied.
// Values are of the form
// Required. The unique name of the table to which the read/modify/write rules
// should be applied. Values are of the form
// `projects/<project>/instances/<instance>/tables/<table>`.
string table_name = 1 [
(google.api.field_behavior) = REQUIRED,
Expand All @@ -512,13 +547,15 @@ message ReadModifyWriteRowRequest {
// "default" application profile will be used.
string app_profile_id = 4;

// Required. The key of the row to which the read/modify/write rules should be applied.
// Required. The key of the row to which the read/modify/write rules should be
// applied.
bytes row_key = 2 [(google.api.field_behavior) = REQUIRED];

// Required. Rules specifying how the specified row's contents are to be transformed
// into writes. Entries are applied in order, meaning that earlier rules will
// affect the results of later ones.
repeated ReadModifyWriteRule rules = 3 [(google.api.field_behavior) = REQUIRED];
// Required. Rules specifying how the specified row's contents are to be
// transformed into writes. Entries are applied in order, meaning that earlier
// rules will affect the results of later ones.
repeated ReadModifyWriteRule rules = 3
[(google.api.field_behavior) = REQUIRED];
}

// Response message for Bigtable.ReadModifyWriteRow.
Expand Down
Loading