From 89dfc83b4fed199d70934c34ab7f4c4d17796418 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 13:25:52 -0400 Subject: [PATCH] feat: publish the RequestStats proto (#1177) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: publish the RequestStats proto PiperOrigin-RevId: 476399682 Source-Link: https://github.com/googleapis/googleapis/commit/0c4e682e302268332468f304d0411048e24c85db Source-Link: https://github.com/googleapis/googleapis-gen/commit/ff87f69aad1f2ff06772f917eecbea649797d9d5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZmY4N2Y2OWFhZDFmMmZmMDY3NzJmOTE3ZWVjYmVhNjQ5Nzk3ZDlkNSJ9 * 🦉 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 Co-authored-by: danieljbruce --- protos/google/bigtable/v2/bigtable.proto | 165 +- protos/google/bigtable/v2/request_stats.proto | 117 ++ protos/protos.d.ts | 553 +++++++ protos/protos.js | 1405 ++++++++++++++++- protos/protos.json | 98 +- .../v2/bigtable.check_and_mutate_row.js | 8 +- samples/generated/v2/bigtable.mutate_row.js | 10 +- samples/generated/v2/bigtable.mutate_rows.js | 3 +- .../generated/v2/bigtable.ping_and_warm.js | 5 +- .../v2/bigtable.read_modify_write_row.js | 14 +- samples/generated/v2/bigtable.read_rows.js | 8 +- .../snippet_metadata.google.bigtable.v2.json | 10 +- src/v2/bigtable_client.ts | 46 +- src/v2/bigtable_proto_list.json | 1 + 14 files changed, 2331 insertions(+), 112 deletions(-) create mode 100644 protos/google/bigtable/v2/request_stats.proto diff --git a/protos/google/bigtable/v2/bigtable.proto b/protos/google/bigtable/v2/bigtable.proto index 215b573cb..090c60eb7 100644 --- a/protos/google/bigtable/v2/bigtable.proto +++ b/protos/google/bigtable/v2/bigtable.proto @@ -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"; @@ -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 { @@ -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"; @@ -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" }; @@ -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"; @@ -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 @@ -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: "*" @@ -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. @@ -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"; @@ -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: "*" @@ -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//instances//tables/`. @@ -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 @@ -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. @@ -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. @@ -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//instances//tables/
`. string table_name = 1 [ (google.api.field_behavior) = REQUIRED, @@ -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 { @@ -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) = { @@ -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//instances//tables/
`. string table_name = 1 [ (google.api.field_behavior) = REQUIRED, @@ -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 @@ -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//instances/`. + // Required. The unique name of the instance to check permissions for as well + // as respond. Values are of the form + // `projects//instances/`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -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//instances//tables/
`. string table_name = 1 [ (google.api.field_behavior) = REQUIRED, @@ -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. diff --git a/protos/google/bigtable/v2/request_stats.proto b/protos/google/bigtable/v2/request_stats.proto new file mode 100644 index 000000000..101603504 --- /dev/null +++ b/protos/google/bigtable/v2/request_stats.proto @@ -0,0 +1,117 @@ +// Copyright 2022 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; + +import "google/protobuf/duration.proto"; + +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 = "RequestStatsProto"; +option java_package = "com.google.bigtable.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\V2"; +option ruby_package = "Google::Cloud::Bigtable::V2"; + +// +// Messages related to RequestStats, part of the Slow Queries feature, that can +// help understand the performance of requests. + +// ReadIteratorStats captures information about the iteration of rows or cells +// over the course of a read, e.g. how many results were scanned in a read +// operation versus the results returned. +message ReadIteratorStats { + // The rows seen (scanned) as part of the request. This includes the count of + // rows returned, as captured below. + int64 rows_seen_count = 1; + + // The rows returned as part of the request. + int64 rows_returned_count = 2; + + // The cells seen (scanned) as part of the request. This includes the count of + // cells returned, as captured below. + int64 cells_seen_count = 3; + + // The cells returned as part of the request. + int64 cells_returned_count = 4; + + // The deletes seen as part of the request. + int64 deletes_seen_count = 5; +} + +// RequestLatencyStats provides a measurement of the latency of the request as +// it interacts with different systems over its lifetime, e.g. how long the +// request took to execute within a frontend server. +message RequestLatencyStats { + // The latency measured by the frontend server handling this request, from + // when the request was received, to when this value is sent back in the + // response. For more context on the component that is measuring this latency, + // see: https://cloud.google.com/bigtable/docs/overview + // + // Note: This value may be slightly shorter than the value reported into + // aggregate latency metrics in Monitoring for this request + // (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value + // needs to be sent in the response before the latency measurement including + // that transmission is finalized. + google.protobuf.Duration frontend_server_latency = 1; +} + +// ReadEfficiencyStats captures information about the efficiency of a read. +message ReadEfficiencyStats { + // Iteration stats describe how efficient the read is, e.g. comparing + // rows seen vs. rows returned or cells seen vs cells returned can provide an + // indication of read efficiency (the higher the ratio of seen to retuned the + // better). + ReadIteratorStats read_iterator_stats = 1; + + // Request latency stats describe the time taken to complete a request, from + // the server side. + RequestLatencyStats request_latency_stats = 2; +} + +// AllReadStats captures all known information about a read. +message AllReadStats { + // Iteration stats describe how efficient the read is, e.g. comparing + // rows seen vs. rows returned or cells seen vs cells returned can provide an + // indication of read efficiency (the higher the ratio of seen to retuned the + // better). + ReadIteratorStats read_iterator_stats = 1; + + // Request latency stats describe the time taken to complete a request, from + // the server side. + RequestLatencyStats request_latency_stats = 2; +} + +// RequestStats is the container for additional information pertaining to a +// single request, helpful for evaluating the performance of the sent request. +// Currently, there are the following supported methods: +// * google.bigtable.v2.ReadRows +message RequestStats { + // Information pertaining to each request type received. The type is chosen + // based on the requested view. + // + // See the messages above for additional context. + oneof stats { + // Available with the + // ReadRowsRequest.RequestStatsView.REQUEST_STATS_EFFICIENCY view, see + // package google.bigtable.v2. + ReadEfficiencyStats read_efficiency_stats = 1; + + // Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL + // view, see package google.bigtable.v2. + AllReadStats all_read_stats = 2; + } +} diff --git a/protos/protos.d.ts b/protos/protos.d.ts index a0cd58b4b..4d328f13f 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -10497,6 +10497,9 @@ export namespace google { /** ReadRowsRequest rowsLimit */ rowsLimit?: (number|Long|string|null); + + /** ReadRowsRequest requestStatsView */ + requestStatsView?: (google.bigtable.v2.ReadRowsRequest.RequestStatsView|keyof typeof google.bigtable.v2.ReadRowsRequest.RequestStatsView|null); } /** Represents a ReadRowsRequest. */ @@ -10523,6 +10526,9 @@ export namespace google { /** ReadRowsRequest rowsLimit. */ public rowsLimit: (number|Long|string); + /** ReadRowsRequest requestStatsView. */ + public requestStatsView: (google.bigtable.v2.ReadRowsRequest.RequestStatsView|keyof typeof google.bigtable.v2.ReadRowsRequest.RequestStatsView); + /** * Creates a new ReadRowsRequest instance using the specified properties. * @param [properties] Properties to set @@ -10601,6 +10607,17 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace ReadRowsRequest { + + /** RequestStatsView enum. */ + enum RequestStatsView { + REQUEST_STATS_VIEW_UNSPECIFIED = 0, + REQUEST_STATS_NONE = 1, + REQUEST_STATS_EFFICIENCY = 2, + REQUEST_STATS_FULL = 3 + } + } + /** Properties of a ReadRowsResponse. */ interface IReadRowsResponse { @@ -10609,6 +10626,9 @@ export namespace google { /** ReadRowsResponse lastScannedRowKey */ lastScannedRowKey?: (Uint8Array|string|null); + + /** ReadRowsResponse requestStats */ + requestStats?: (google.bigtable.v2.IRequestStats|null); } /** Represents a ReadRowsResponse. */ @@ -10626,6 +10646,9 @@ export namespace google { /** ReadRowsResponse lastScannedRowKey. */ public lastScannedRowKey: (Uint8Array|string); + /** ReadRowsResponse requestStats. */ + public requestStats?: (google.bigtable.v2.IRequestStats|null); + /** * Creates a new ReadRowsResponse instance using the specified properties. * @param [properties] Properties to set @@ -14473,6 +14496,536 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ReadIteratorStats. */ + interface IReadIteratorStats { + + /** ReadIteratorStats rowsSeenCount */ + rowsSeenCount?: (number|Long|string|null); + + /** ReadIteratorStats rowsReturnedCount */ + rowsReturnedCount?: (number|Long|string|null); + + /** ReadIteratorStats cellsSeenCount */ + cellsSeenCount?: (number|Long|string|null); + + /** ReadIteratorStats cellsReturnedCount */ + cellsReturnedCount?: (number|Long|string|null); + + /** ReadIteratorStats deletesSeenCount */ + deletesSeenCount?: (number|Long|string|null); + } + + /** Represents a ReadIteratorStats. */ + class ReadIteratorStats implements IReadIteratorStats { + + /** + * Constructs a new ReadIteratorStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IReadIteratorStats); + + /** ReadIteratorStats rowsSeenCount. */ + public rowsSeenCount: (number|Long|string); + + /** ReadIteratorStats rowsReturnedCount. */ + public rowsReturnedCount: (number|Long|string); + + /** ReadIteratorStats cellsSeenCount. */ + public cellsSeenCount: (number|Long|string); + + /** ReadIteratorStats cellsReturnedCount. */ + public cellsReturnedCount: (number|Long|string); + + /** ReadIteratorStats deletesSeenCount. */ + public deletesSeenCount: (number|Long|string); + + /** + * Creates a new ReadIteratorStats instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadIteratorStats instance + */ + public static create(properties?: google.bigtable.v2.IReadIteratorStats): google.bigtable.v2.ReadIteratorStats; + + /** + * Encodes the specified ReadIteratorStats message. Does not implicitly {@link google.bigtable.v2.ReadIteratorStats.verify|verify} messages. + * @param message ReadIteratorStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IReadIteratorStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadIteratorStats message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadIteratorStats.verify|verify} messages. + * @param message ReadIteratorStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IReadIteratorStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadIteratorStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadIteratorStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadIteratorStats; + + /** + * Decodes a ReadIteratorStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadIteratorStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadIteratorStats; + + /** + * Verifies a ReadIteratorStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadIteratorStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadIteratorStats + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadIteratorStats; + + /** + * Creates a plain object from a ReadIteratorStats message. Also converts values to other types if specified. + * @param message ReadIteratorStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadIteratorStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadIteratorStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadIteratorStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RequestLatencyStats. */ + interface IRequestLatencyStats { + + /** RequestLatencyStats frontendServerLatency */ + frontendServerLatency?: (google.protobuf.IDuration|null); + } + + /** Represents a RequestLatencyStats. */ + class RequestLatencyStats implements IRequestLatencyStats { + + /** + * Constructs a new RequestLatencyStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IRequestLatencyStats); + + /** RequestLatencyStats frontendServerLatency. */ + public frontendServerLatency?: (google.protobuf.IDuration|null); + + /** + * Creates a new RequestLatencyStats instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestLatencyStats instance + */ + public static create(properties?: google.bigtable.v2.IRequestLatencyStats): google.bigtable.v2.RequestLatencyStats; + + /** + * Encodes the specified RequestLatencyStats message. Does not implicitly {@link google.bigtable.v2.RequestLatencyStats.verify|verify} messages. + * @param message RequestLatencyStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IRequestLatencyStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestLatencyStats message, length delimited. Does not implicitly {@link google.bigtable.v2.RequestLatencyStats.verify|verify} messages. + * @param message RequestLatencyStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IRequestLatencyStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestLatencyStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.RequestLatencyStats; + + /** + * Decodes a RequestLatencyStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.RequestLatencyStats; + + /** + * Verifies a RequestLatencyStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RequestLatencyStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestLatencyStats + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.RequestLatencyStats; + + /** + * Creates a plain object from a RequestLatencyStats message. Also converts values to other types if specified. + * @param message RequestLatencyStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.RequestLatencyStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestLatencyStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RequestLatencyStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadEfficiencyStats. */ + interface IReadEfficiencyStats { + + /** ReadEfficiencyStats readIteratorStats */ + readIteratorStats?: (google.bigtable.v2.IReadIteratorStats|null); + + /** ReadEfficiencyStats requestLatencyStats */ + requestLatencyStats?: (google.bigtable.v2.IRequestLatencyStats|null); + } + + /** Represents a ReadEfficiencyStats. */ + class ReadEfficiencyStats implements IReadEfficiencyStats { + + /** + * Constructs a new ReadEfficiencyStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IReadEfficiencyStats); + + /** ReadEfficiencyStats readIteratorStats. */ + public readIteratorStats?: (google.bigtable.v2.IReadIteratorStats|null); + + /** ReadEfficiencyStats requestLatencyStats. */ + public requestLatencyStats?: (google.bigtable.v2.IRequestLatencyStats|null); + + /** + * Creates a new ReadEfficiencyStats instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadEfficiencyStats instance + */ + public static create(properties?: google.bigtable.v2.IReadEfficiencyStats): google.bigtable.v2.ReadEfficiencyStats; + + /** + * Encodes the specified ReadEfficiencyStats message. Does not implicitly {@link google.bigtable.v2.ReadEfficiencyStats.verify|verify} messages. + * @param message ReadEfficiencyStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IReadEfficiencyStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadEfficiencyStats message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadEfficiencyStats.verify|verify} messages. + * @param message ReadEfficiencyStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IReadEfficiencyStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadEfficiencyStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadEfficiencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.ReadEfficiencyStats; + + /** + * Decodes a ReadEfficiencyStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadEfficiencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.ReadEfficiencyStats; + + /** + * Verifies a ReadEfficiencyStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadEfficiencyStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadEfficiencyStats + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.ReadEfficiencyStats; + + /** + * Creates a plain object from a ReadEfficiencyStats message. Also converts values to other types if specified. + * @param message ReadEfficiencyStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.ReadEfficiencyStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadEfficiencyStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadEfficiencyStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AllReadStats. */ + interface IAllReadStats { + + /** AllReadStats readIteratorStats */ + readIteratorStats?: (google.bigtable.v2.IReadIteratorStats|null); + + /** AllReadStats requestLatencyStats */ + requestLatencyStats?: (google.bigtable.v2.IRequestLatencyStats|null); + } + + /** Represents an AllReadStats. */ + class AllReadStats implements IAllReadStats { + + /** + * Constructs a new AllReadStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IAllReadStats); + + /** AllReadStats readIteratorStats. */ + public readIteratorStats?: (google.bigtable.v2.IReadIteratorStats|null); + + /** AllReadStats requestLatencyStats. */ + public requestLatencyStats?: (google.bigtable.v2.IRequestLatencyStats|null); + + /** + * Creates a new AllReadStats instance using the specified properties. + * @param [properties] Properties to set + * @returns AllReadStats instance + */ + public static create(properties?: google.bigtable.v2.IAllReadStats): google.bigtable.v2.AllReadStats; + + /** + * Encodes the specified AllReadStats message. Does not implicitly {@link google.bigtable.v2.AllReadStats.verify|verify} messages. + * @param message AllReadStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IAllReadStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AllReadStats message, length delimited. Does not implicitly {@link google.bigtable.v2.AllReadStats.verify|verify} messages. + * @param message AllReadStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IAllReadStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AllReadStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AllReadStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.AllReadStats; + + /** + * Decodes an AllReadStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AllReadStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.AllReadStats; + + /** + * Verifies an AllReadStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AllReadStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AllReadStats + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.AllReadStats; + + /** + * Creates a plain object from an AllReadStats message. Also converts values to other types if specified. + * @param message AllReadStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.AllReadStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AllReadStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AllReadStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RequestStats. */ + interface IRequestStats { + + /** RequestStats readEfficiencyStats */ + readEfficiencyStats?: (google.bigtable.v2.IReadEfficiencyStats|null); + + /** RequestStats allReadStats */ + allReadStats?: (google.bigtable.v2.IAllReadStats|null); + } + + /** Represents a RequestStats. */ + class RequestStats implements IRequestStats { + + /** + * Constructs a new RequestStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.v2.IRequestStats); + + /** RequestStats readEfficiencyStats. */ + public readEfficiencyStats?: (google.bigtable.v2.IReadEfficiencyStats|null); + + /** RequestStats allReadStats. */ + public allReadStats?: (google.bigtable.v2.IAllReadStats|null); + + /** RequestStats stats. */ + public stats?: ("readEfficiencyStats"|"allReadStats"); + + /** + * Creates a new RequestStats instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestStats instance + */ + public static create(properties?: google.bigtable.v2.IRequestStats): google.bigtable.v2.RequestStats; + + /** + * Encodes the specified RequestStats message. Does not implicitly {@link google.bigtable.v2.RequestStats.verify|verify} messages. + * @param message RequestStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.v2.IRequestStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestStats message, length delimited. Does not implicitly {@link google.bigtable.v2.RequestStats.verify|verify} messages. + * @param message RequestStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.v2.IRequestStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.v2.RequestStats; + + /** + * Decodes a RequestStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.v2.RequestStats; + + /** + * Verifies a RequestStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RequestStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestStats + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.v2.RequestStats; + + /** + * Creates a plain object from a RequestStats message. Also converts values to other types if specified. + * @param message RequestStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.v2.RequestStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RequestStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a ResponseParams. */ interface IResponseParams { diff --git a/protos/protos.js b/protos/protos.js index 9bfd8581f..ac278d23c 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -24320,6 +24320,7 @@ * @property {google.bigtable.v2.IRowSet|null} [rows] ReadRowsRequest rows * @property {google.bigtable.v2.IRowFilter|null} [filter] ReadRowsRequest filter * @property {number|Long|null} [rowsLimit] ReadRowsRequest rowsLimit + * @property {google.bigtable.v2.ReadRowsRequest.RequestStatsView|null} [requestStatsView] ReadRowsRequest requestStatsView */ /** @@ -24377,6 +24378,14 @@ */ ReadRowsRequest.prototype.rowsLimit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * ReadRowsRequest requestStatsView. + * @member {google.bigtable.v2.ReadRowsRequest.RequestStatsView} requestStatsView + * @memberof google.bigtable.v2.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.requestStatsView = 0; + /** * Creates a new ReadRowsRequest instance using the specified properties. * @function create @@ -24411,6 +24420,8 @@ writer.uint32(/* id 4, wireType 0 =*/32).int64(message.rowsLimit); if (message.appProfileId != null && Object.hasOwnProperty.call(message, "appProfileId")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.appProfileId); + if (message.requestStatsView != null && Object.hasOwnProperty.call(message, "requestStatsView")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.requestStatsView); return writer; }; @@ -24465,6 +24476,10 @@ message.rowsLimit = reader.int64(); break; } + case 6: { + message.requestStatsView = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -24519,6 +24534,16 @@ if (message.rowsLimit != null && message.hasOwnProperty("rowsLimit")) if (!$util.isInteger(message.rowsLimit) && !(message.rowsLimit && $util.isInteger(message.rowsLimit.low) && $util.isInteger(message.rowsLimit.high))) return "rowsLimit: integer|Long expected"; + if (message.requestStatsView != null && message.hasOwnProperty("requestStatsView")) + switch (message.requestStatsView) { + default: + return "requestStatsView: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } return null; }; @@ -24557,6 +24582,24 @@ message.rowsLimit = object.rowsLimit; else if (typeof object.rowsLimit === "object") message.rowsLimit = new $util.LongBits(object.rowsLimit.low >>> 0, object.rowsLimit.high >>> 0).toNumber(); + switch (object.requestStatsView) { + case "REQUEST_STATS_VIEW_UNSPECIFIED": + case 0: + message.requestStatsView = 0; + break; + case "REQUEST_STATS_NONE": + case 1: + message.requestStatsView = 1; + break; + case "REQUEST_STATS_EFFICIENCY": + case 2: + message.requestStatsView = 2; + break; + case "REQUEST_STATS_FULL": + case 3: + message.requestStatsView = 3; + break; + } return message; }; @@ -24583,6 +24626,7 @@ } else object.rowsLimit = options.longs === String ? "0" : 0; object.appProfileId = ""; + object.requestStatsView = options.enums === String ? "REQUEST_STATS_VIEW_UNSPECIFIED" : 0; } if (message.tableName != null && message.hasOwnProperty("tableName")) object.tableName = message.tableName; @@ -24597,6 +24641,8 @@ object.rowsLimit = options.longs === String ? $util.Long.prototype.toString.call(message.rowsLimit) : options.longs === Number ? new $util.LongBits(message.rowsLimit.low >>> 0, message.rowsLimit.high >>> 0).toNumber() : message.rowsLimit; if (message.appProfileId != null && message.hasOwnProperty("appProfileId")) object.appProfileId = message.appProfileId; + if (message.requestStatsView != null && message.hasOwnProperty("requestStatsView")) + object.requestStatsView = options.enums === String ? $root.google.bigtable.v2.ReadRowsRequest.RequestStatsView[message.requestStatsView] : message.requestStatsView; return object; }; @@ -24626,6 +24672,24 @@ return typeUrlPrefix + "/google.bigtable.v2.ReadRowsRequest"; }; + /** + * RequestStatsView enum. + * @name google.bigtable.v2.ReadRowsRequest.RequestStatsView + * @enum {number} + * @property {number} REQUEST_STATS_VIEW_UNSPECIFIED=0 REQUEST_STATS_VIEW_UNSPECIFIED value + * @property {number} REQUEST_STATS_NONE=1 REQUEST_STATS_NONE value + * @property {number} REQUEST_STATS_EFFICIENCY=2 REQUEST_STATS_EFFICIENCY value + * @property {number} REQUEST_STATS_FULL=3 REQUEST_STATS_FULL value + */ + ReadRowsRequest.RequestStatsView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REQUEST_STATS_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "REQUEST_STATS_NONE"] = 1; + values[valuesById[2] = "REQUEST_STATS_EFFICIENCY"] = 2; + values[valuesById[3] = "REQUEST_STATS_FULL"] = 3; + return values; + })(); + return ReadRowsRequest; })(); @@ -24637,6 +24701,7 @@ * @interface IReadRowsResponse * @property {Array.|null} [chunks] ReadRowsResponse chunks * @property {Uint8Array|null} [lastScannedRowKey] ReadRowsResponse lastScannedRowKey + * @property {google.bigtable.v2.IRequestStats|null} [requestStats] ReadRowsResponse requestStats */ /** @@ -24671,6 +24736,14 @@ */ ReadRowsResponse.prototype.lastScannedRowKey = $util.newBuffer([]); + /** + * ReadRowsResponse requestStats. + * @member {google.bigtable.v2.IRequestStats|null|undefined} requestStats + * @memberof google.bigtable.v2.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.requestStats = null; + /** * Creates a new ReadRowsResponse instance using the specified properties. * @function create @@ -24700,6 +24773,8 @@ $root.google.bigtable.v2.ReadRowsResponse.CellChunk.encode(message.chunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.lastScannedRowKey != null && Object.hasOwnProperty.call(message, "lastScannedRowKey")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.lastScannedRowKey); + if (message.requestStats != null && Object.hasOwnProperty.call(message, "requestStats")) + $root.google.bigtable.v2.RequestStats.encode(message.requestStats, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -24744,6 +24819,10 @@ message.lastScannedRowKey = reader.bytes(); break; } + case 3: { + message.requestStats = $root.google.bigtable.v2.RequestStats.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -24791,6 +24870,11 @@ if (message.lastScannedRowKey != null && message.hasOwnProperty("lastScannedRowKey")) if (!(message.lastScannedRowKey && typeof message.lastScannedRowKey.length === "number" || $util.isString(message.lastScannedRowKey))) return "lastScannedRowKey: buffer expected"; + if (message.requestStats != null && message.hasOwnProperty("requestStats")) { + var error = $root.google.bigtable.v2.RequestStats.verify(message.requestStats); + if (error) + return "requestStats." + error; + } return null; }; @@ -24821,6 +24905,11 @@ $util.base64.decode(object.lastScannedRowKey, message.lastScannedRowKey = $util.newBuffer($util.base64.length(object.lastScannedRowKey)), 0); else if (object.lastScannedRowKey.length >= 0) message.lastScannedRowKey = object.lastScannedRowKey; + if (object.requestStats != null) { + if (typeof object.requestStats !== "object") + throw TypeError(".google.bigtable.v2.ReadRowsResponse.requestStats: object expected"); + message.requestStats = $root.google.bigtable.v2.RequestStats.fromObject(object.requestStats); + } return message; }; @@ -24839,7 +24928,7 @@ var object = {}; if (options.arrays || options.defaults) object.chunks = []; - if (options.defaults) + if (options.defaults) { if (options.bytes === String) object.lastScannedRowKey = ""; else { @@ -24847,6 +24936,8 @@ if (options.bytes !== Array) object.lastScannedRowKey = $util.newBuffer(object.lastScannedRowKey); } + object.requestStats = null; + } if (message.chunks && message.chunks.length) { object.chunks = []; for (var j = 0; j < message.chunks.length; ++j) @@ -24854,6 +24945,8 @@ } if (message.lastScannedRowKey != null && message.hasOwnProperty("lastScannedRowKey")) object.lastScannedRowKey = options.bytes === String ? $util.base64.encode(message.lastScannedRowKey, 0, message.lastScannedRowKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastScannedRowKey) : message.lastScannedRowKey; + if (message.requestStats != null && message.hasOwnProperty("requestStats")) + object.requestStats = $root.google.bigtable.v2.RequestStats.toObject(message.requestStats, options); return object; }; @@ -34492,6 +34585,1316 @@ return ReadModifyWriteRule; })(); + v2.ReadIteratorStats = (function() { + + /** + * Properties of a ReadIteratorStats. + * @memberof google.bigtable.v2 + * @interface IReadIteratorStats + * @property {number|Long|null} [rowsSeenCount] ReadIteratorStats rowsSeenCount + * @property {number|Long|null} [rowsReturnedCount] ReadIteratorStats rowsReturnedCount + * @property {number|Long|null} [cellsSeenCount] ReadIteratorStats cellsSeenCount + * @property {number|Long|null} [cellsReturnedCount] ReadIteratorStats cellsReturnedCount + * @property {number|Long|null} [deletesSeenCount] ReadIteratorStats deletesSeenCount + */ + + /** + * Constructs a new ReadIteratorStats. + * @memberof google.bigtable.v2 + * @classdesc Represents a ReadIteratorStats. + * @implements IReadIteratorStats + * @constructor + * @param {google.bigtable.v2.IReadIteratorStats=} [properties] Properties to set + */ + function ReadIteratorStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadIteratorStats rowsSeenCount. + * @member {number|Long} rowsSeenCount + * @memberof google.bigtable.v2.ReadIteratorStats + * @instance + */ + ReadIteratorStats.prototype.rowsSeenCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadIteratorStats rowsReturnedCount. + * @member {number|Long} rowsReturnedCount + * @memberof google.bigtable.v2.ReadIteratorStats + * @instance + */ + ReadIteratorStats.prototype.rowsReturnedCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadIteratorStats cellsSeenCount. + * @member {number|Long} cellsSeenCount + * @memberof google.bigtable.v2.ReadIteratorStats + * @instance + */ + ReadIteratorStats.prototype.cellsSeenCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadIteratorStats cellsReturnedCount. + * @member {number|Long} cellsReturnedCount + * @memberof google.bigtable.v2.ReadIteratorStats + * @instance + */ + ReadIteratorStats.prototype.cellsReturnedCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadIteratorStats deletesSeenCount. + * @member {number|Long} deletesSeenCount + * @memberof google.bigtable.v2.ReadIteratorStats + * @instance + */ + ReadIteratorStats.prototype.deletesSeenCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ReadIteratorStats instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadIteratorStats + * @static + * @param {google.bigtable.v2.IReadIteratorStats=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadIteratorStats} ReadIteratorStats instance + */ + ReadIteratorStats.create = function create(properties) { + return new ReadIteratorStats(properties); + }; + + /** + * Encodes the specified ReadIteratorStats message. Does not implicitly {@link google.bigtable.v2.ReadIteratorStats.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadIteratorStats + * @static + * @param {google.bigtable.v2.IReadIteratorStats} message ReadIteratorStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadIteratorStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rowsSeenCount != null && Object.hasOwnProperty.call(message, "rowsSeenCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.rowsSeenCount); + if (message.rowsReturnedCount != null && Object.hasOwnProperty.call(message, "rowsReturnedCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.rowsReturnedCount); + if (message.cellsSeenCount != null && Object.hasOwnProperty.call(message, "cellsSeenCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.cellsSeenCount); + if (message.cellsReturnedCount != null && Object.hasOwnProperty.call(message, "cellsReturnedCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.cellsReturnedCount); + if (message.deletesSeenCount != null && Object.hasOwnProperty.call(message, "deletesSeenCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.deletesSeenCount); + return writer; + }; + + /** + * Encodes the specified ReadIteratorStats message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadIteratorStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadIteratorStats + * @static + * @param {google.bigtable.v2.IReadIteratorStats} message ReadIteratorStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadIteratorStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadIteratorStats message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadIteratorStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadIteratorStats} ReadIteratorStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadIteratorStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadIteratorStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rowsSeenCount = reader.int64(); + break; + } + case 2: { + message.rowsReturnedCount = reader.int64(); + break; + } + case 3: { + message.cellsSeenCount = reader.int64(); + break; + } + case 4: { + message.cellsReturnedCount = reader.int64(); + break; + } + case 5: { + message.deletesSeenCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadIteratorStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadIteratorStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadIteratorStats} ReadIteratorStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadIteratorStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadIteratorStats message. + * @function verify + * @memberof google.bigtable.v2.ReadIteratorStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadIteratorStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rowsSeenCount != null && message.hasOwnProperty("rowsSeenCount")) + if (!$util.isInteger(message.rowsSeenCount) && !(message.rowsSeenCount && $util.isInteger(message.rowsSeenCount.low) && $util.isInteger(message.rowsSeenCount.high))) + return "rowsSeenCount: integer|Long expected"; + if (message.rowsReturnedCount != null && message.hasOwnProperty("rowsReturnedCount")) + if (!$util.isInteger(message.rowsReturnedCount) && !(message.rowsReturnedCount && $util.isInteger(message.rowsReturnedCount.low) && $util.isInteger(message.rowsReturnedCount.high))) + return "rowsReturnedCount: integer|Long expected"; + if (message.cellsSeenCount != null && message.hasOwnProperty("cellsSeenCount")) + if (!$util.isInteger(message.cellsSeenCount) && !(message.cellsSeenCount && $util.isInteger(message.cellsSeenCount.low) && $util.isInteger(message.cellsSeenCount.high))) + return "cellsSeenCount: integer|Long expected"; + if (message.cellsReturnedCount != null && message.hasOwnProperty("cellsReturnedCount")) + if (!$util.isInteger(message.cellsReturnedCount) && !(message.cellsReturnedCount && $util.isInteger(message.cellsReturnedCount.low) && $util.isInteger(message.cellsReturnedCount.high))) + return "cellsReturnedCount: integer|Long expected"; + if (message.deletesSeenCount != null && message.hasOwnProperty("deletesSeenCount")) + if (!$util.isInteger(message.deletesSeenCount) && !(message.deletesSeenCount && $util.isInteger(message.deletesSeenCount.low) && $util.isInteger(message.deletesSeenCount.high))) + return "deletesSeenCount: integer|Long expected"; + return null; + }; + + /** + * Creates a ReadIteratorStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadIteratorStats + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadIteratorStats} ReadIteratorStats + */ + ReadIteratorStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadIteratorStats) + return object; + var message = new $root.google.bigtable.v2.ReadIteratorStats(); + if (object.rowsSeenCount != null) + if ($util.Long) + (message.rowsSeenCount = $util.Long.fromValue(object.rowsSeenCount)).unsigned = false; + else if (typeof object.rowsSeenCount === "string") + message.rowsSeenCount = parseInt(object.rowsSeenCount, 10); + else if (typeof object.rowsSeenCount === "number") + message.rowsSeenCount = object.rowsSeenCount; + else if (typeof object.rowsSeenCount === "object") + message.rowsSeenCount = new $util.LongBits(object.rowsSeenCount.low >>> 0, object.rowsSeenCount.high >>> 0).toNumber(); + if (object.rowsReturnedCount != null) + if ($util.Long) + (message.rowsReturnedCount = $util.Long.fromValue(object.rowsReturnedCount)).unsigned = false; + else if (typeof object.rowsReturnedCount === "string") + message.rowsReturnedCount = parseInt(object.rowsReturnedCount, 10); + else if (typeof object.rowsReturnedCount === "number") + message.rowsReturnedCount = object.rowsReturnedCount; + else if (typeof object.rowsReturnedCount === "object") + message.rowsReturnedCount = new $util.LongBits(object.rowsReturnedCount.low >>> 0, object.rowsReturnedCount.high >>> 0).toNumber(); + if (object.cellsSeenCount != null) + if ($util.Long) + (message.cellsSeenCount = $util.Long.fromValue(object.cellsSeenCount)).unsigned = false; + else if (typeof object.cellsSeenCount === "string") + message.cellsSeenCount = parseInt(object.cellsSeenCount, 10); + else if (typeof object.cellsSeenCount === "number") + message.cellsSeenCount = object.cellsSeenCount; + else if (typeof object.cellsSeenCount === "object") + message.cellsSeenCount = new $util.LongBits(object.cellsSeenCount.low >>> 0, object.cellsSeenCount.high >>> 0).toNumber(); + if (object.cellsReturnedCount != null) + if ($util.Long) + (message.cellsReturnedCount = $util.Long.fromValue(object.cellsReturnedCount)).unsigned = false; + else if (typeof object.cellsReturnedCount === "string") + message.cellsReturnedCount = parseInt(object.cellsReturnedCount, 10); + else if (typeof object.cellsReturnedCount === "number") + message.cellsReturnedCount = object.cellsReturnedCount; + else if (typeof object.cellsReturnedCount === "object") + message.cellsReturnedCount = new $util.LongBits(object.cellsReturnedCount.low >>> 0, object.cellsReturnedCount.high >>> 0).toNumber(); + if (object.deletesSeenCount != null) + if ($util.Long) + (message.deletesSeenCount = $util.Long.fromValue(object.deletesSeenCount)).unsigned = false; + else if (typeof object.deletesSeenCount === "string") + message.deletesSeenCount = parseInt(object.deletesSeenCount, 10); + else if (typeof object.deletesSeenCount === "number") + message.deletesSeenCount = object.deletesSeenCount; + else if (typeof object.deletesSeenCount === "object") + message.deletesSeenCount = new $util.LongBits(object.deletesSeenCount.low >>> 0, object.deletesSeenCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ReadIteratorStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadIteratorStats + * @static + * @param {google.bigtable.v2.ReadIteratorStats} message ReadIteratorStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadIteratorStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowsSeenCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowsSeenCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowsReturnedCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowsReturnedCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.cellsSeenCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.cellsSeenCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.cellsReturnedCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.cellsReturnedCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.deletesSeenCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.deletesSeenCount = options.longs === String ? "0" : 0; + } + if (message.rowsSeenCount != null && message.hasOwnProperty("rowsSeenCount")) + if (typeof message.rowsSeenCount === "number") + object.rowsSeenCount = options.longs === String ? String(message.rowsSeenCount) : message.rowsSeenCount; + else + object.rowsSeenCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowsSeenCount) : options.longs === Number ? new $util.LongBits(message.rowsSeenCount.low >>> 0, message.rowsSeenCount.high >>> 0).toNumber() : message.rowsSeenCount; + if (message.rowsReturnedCount != null && message.hasOwnProperty("rowsReturnedCount")) + if (typeof message.rowsReturnedCount === "number") + object.rowsReturnedCount = options.longs === String ? String(message.rowsReturnedCount) : message.rowsReturnedCount; + else + object.rowsReturnedCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowsReturnedCount) : options.longs === Number ? new $util.LongBits(message.rowsReturnedCount.low >>> 0, message.rowsReturnedCount.high >>> 0).toNumber() : message.rowsReturnedCount; + if (message.cellsSeenCount != null && message.hasOwnProperty("cellsSeenCount")) + if (typeof message.cellsSeenCount === "number") + object.cellsSeenCount = options.longs === String ? String(message.cellsSeenCount) : message.cellsSeenCount; + else + object.cellsSeenCount = options.longs === String ? $util.Long.prototype.toString.call(message.cellsSeenCount) : options.longs === Number ? new $util.LongBits(message.cellsSeenCount.low >>> 0, message.cellsSeenCount.high >>> 0).toNumber() : message.cellsSeenCount; + if (message.cellsReturnedCount != null && message.hasOwnProperty("cellsReturnedCount")) + if (typeof message.cellsReturnedCount === "number") + object.cellsReturnedCount = options.longs === String ? String(message.cellsReturnedCount) : message.cellsReturnedCount; + else + object.cellsReturnedCount = options.longs === String ? $util.Long.prototype.toString.call(message.cellsReturnedCount) : options.longs === Number ? new $util.LongBits(message.cellsReturnedCount.low >>> 0, message.cellsReturnedCount.high >>> 0).toNumber() : message.cellsReturnedCount; + if (message.deletesSeenCount != null && message.hasOwnProperty("deletesSeenCount")) + if (typeof message.deletesSeenCount === "number") + object.deletesSeenCount = options.longs === String ? String(message.deletesSeenCount) : message.deletesSeenCount; + else + object.deletesSeenCount = options.longs === String ? $util.Long.prototype.toString.call(message.deletesSeenCount) : options.longs === Number ? new $util.LongBits(message.deletesSeenCount.low >>> 0, message.deletesSeenCount.high >>> 0).toNumber() : message.deletesSeenCount; + return object; + }; + + /** + * Converts this ReadIteratorStats to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadIteratorStats + * @instance + * @returns {Object.} JSON object + */ + ReadIteratorStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadIteratorStats + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadIteratorStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadIteratorStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadIteratorStats"; + }; + + return ReadIteratorStats; + })(); + + v2.RequestLatencyStats = (function() { + + /** + * Properties of a RequestLatencyStats. + * @memberof google.bigtable.v2 + * @interface IRequestLatencyStats + * @property {google.protobuf.IDuration|null} [frontendServerLatency] RequestLatencyStats frontendServerLatency + */ + + /** + * Constructs a new RequestLatencyStats. + * @memberof google.bigtable.v2 + * @classdesc Represents a RequestLatencyStats. + * @implements IRequestLatencyStats + * @constructor + * @param {google.bigtable.v2.IRequestLatencyStats=} [properties] Properties to set + */ + function RequestLatencyStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestLatencyStats frontendServerLatency. + * @member {google.protobuf.IDuration|null|undefined} frontendServerLatency + * @memberof google.bigtable.v2.RequestLatencyStats + * @instance + */ + RequestLatencyStats.prototype.frontendServerLatency = null; + + /** + * Creates a new RequestLatencyStats instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {google.bigtable.v2.IRequestLatencyStats=} [properties] Properties to set + * @returns {google.bigtable.v2.RequestLatencyStats} RequestLatencyStats instance + */ + RequestLatencyStats.create = function create(properties) { + return new RequestLatencyStats(properties); + }; + + /** + * Encodes the specified RequestLatencyStats message. Does not implicitly {@link google.bigtable.v2.RequestLatencyStats.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {google.bigtable.v2.IRequestLatencyStats} message RequestLatencyStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestLatencyStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frontendServerLatency != null && Object.hasOwnProperty.call(message, "frontendServerLatency")) + $root.google.protobuf.Duration.encode(message.frontendServerLatency, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestLatencyStats message, length delimited. Does not implicitly {@link google.bigtable.v2.RequestLatencyStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {google.bigtable.v2.IRequestLatencyStats} message RequestLatencyStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestLatencyStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestLatencyStats message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.RequestLatencyStats} RequestLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestLatencyStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.RequestLatencyStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.frontendServerLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestLatencyStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.RequestLatencyStats} RequestLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestLatencyStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestLatencyStats message. + * @function verify + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestLatencyStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frontendServerLatency != null && message.hasOwnProperty("frontendServerLatency")) { + var error = $root.google.protobuf.Duration.verify(message.frontendServerLatency); + if (error) + return "frontendServerLatency." + error; + } + return null; + }; + + /** + * Creates a RequestLatencyStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.RequestLatencyStats} RequestLatencyStats + */ + RequestLatencyStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.RequestLatencyStats) + return object; + var message = new $root.google.bigtable.v2.RequestLatencyStats(); + if (object.frontendServerLatency != null) { + if (typeof object.frontendServerLatency !== "object") + throw TypeError(".google.bigtable.v2.RequestLatencyStats.frontendServerLatency: object expected"); + message.frontendServerLatency = $root.google.protobuf.Duration.fromObject(object.frontendServerLatency); + } + return message; + }; + + /** + * Creates a plain object from a RequestLatencyStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {google.bigtable.v2.RequestLatencyStats} message RequestLatencyStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestLatencyStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.frontendServerLatency = null; + if (message.frontendServerLatency != null && message.hasOwnProperty("frontendServerLatency")) + object.frontendServerLatency = $root.google.protobuf.Duration.toObject(message.frontendServerLatency, options); + return object; + }; + + /** + * Converts this RequestLatencyStats to JSON. + * @function toJSON + * @memberof google.bigtable.v2.RequestLatencyStats + * @instance + * @returns {Object.} JSON object + */ + RequestLatencyStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RequestLatencyStats + * @function getTypeUrl + * @memberof google.bigtable.v2.RequestLatencyStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RequestLatencyStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.RequestLatencyStats"; + }; + + return RequestLatencyStats; + })(); + + v2.ReadEfficiencyStats = (function() { + + /** + * Properties of a ReadEfficiencyStats. + * @memberof google.bigtable.v2 + * @interface IReadEfficiencyStats + * @property {google.bigtable.v2.IReadIteratorStats|null} [readIteratorStats] ReadEfficiencyStats readIteratorStats + * @property {google.bigtable.v2.IRequestLatencyStats|null} [requestLatencyStats] ReadEfficiencyStats requestLatencyStats + */ + + /** + * Constructs a new ReadEfficiencyStats. + * @memberof google.bigtable.v2 + * @classdesc Represents a ReadEfficiencyStats. + * @implements IReadEfficiencyStats + * @constructor + * @param {google.bigtable.v2.IReadEfficiencyStats=} [properties] Properties to set + */ + function ReadEfficiencyStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadEfficiencyStats readIteratorStats. + * @member {google.bigtable.v2.IReadIteratorStats|null|undefined} readIteratorStats + * @memberof google.bigtable.v2.ReadEfficiencyStats + * @instance + */ + ReadEfficiencyStats.prototype.readIteratorStats = null; + + /** + * ReadEfficiencyStats requestLatencyStats. + * @member {google.bigtable.v2.IRequestLatencyStats|null|undefined} requestLatencyStats + * @memberof google.bigtable.v2.ReadEfficiencyStats + * @instance + */ + ReadEfficiencyStats.prototype.requestLatencyStats = null; + + /** + * Creates a new ReadEfficiencyStats instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.ReadEfficiencyStats + * @static + * @param {google.bigtable.v2.IReadEfficiencyStats=} [properties] Properties to set + * @returns {google.bigtable.v2.ReadEfficiencyStats} ReadEfficiencyStats instance + */ + ReadEfficiencyStats.create = function create(properties) { + return new ReadEfficiencyStats(properties); + }; + + /** + * Encodes the specified ReadEfficiencyStats message. Does not implicitly {@link google.bigtable.v2.ReadEfficiencyStats.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.ReadEfficiencyStats + * @static + * @param {google.bigtable.v2.IReadEfficiencyStats} message ReadEfficiencyStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadEfficiencyStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readIteratorStats != null && Object.hasOwnProperty.call(message, "readIteratorStats")) + $root.google.bigtable.v2.ReadIteratorStats.encode(message.readIteratorStats, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestLatencyStats != null && Object.hasOwnProperty.call(message, "requestLatencyStats")) + $root.google.bigtable.v2.RequestLatencyStats.encode(message.requestLatencyStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadEfficiencyStats message, length delimited. Does not implicitly {@link google.bigtable.v2.ReadEfficiencyStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.ReadEfficiencyStats + * @static + * @param {google.bigtable.v2.IReadEfficiencyStats} message ReadEfficiencyStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadEfficiencyStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadEfficiencyStats message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.ReadEfficiencyStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.ReadEfficiencyStats} ReadEfficiencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadEfficiencyStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.ReadEfficiencyStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.readIteratorStats = $root.google.bigtable.v2.ReadIteratorStats.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestLatencyStats = $root.google.bigtable.v2.RequestLatencyStats.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadEfficiencyStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.ReadEfficiencyStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.ReadEfficiencyStats} ReadEfficiencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadEfficiencyStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadEfficiencyStats message. + * @function verify + * @memberof google.bigtable.v2.ReadEfficiencyStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadEfficiencyStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readIteratorStats != null && message.hasOwnProperty("readIteratorStats")) { + var error = $root.google.bigtable.v2.ReadIteratorStats.verify(message.readIteratorStats); + if (error) + return "readIteratorStats." + error; + } + if (message.requestLatencyStats != null && message.hasOwnProperty("requestLatencyStats")) { + var error = $root.google.bigtable.v2.RequestLatencyStats.verify(message.requestLatencyStats); + if (error) + return "requestLatencyStats." + error; + } + return null; + }; + + /** + * Creates a ReadEfficiencyStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.ReadEfficiencyStats + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.ReadEfficiencyStats} ReadEfficiencyStats + */ + ReadEfficiencyStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.ReadEfficiencyStats) + return object; + var message = new $root.google.bigtable.v2.ReadEfficiencyStats(); + if (object.readIteratorStats != null) { + if (typeof object.readIteratorStats !== "object") + throw TypeError(".google.bigtable.v2.ReadEfficiencyStats.readIteratorStats: object expected"); + message.readIteratorStats = $root.google.bigtable.v2.ReadIteratorStats.fromObject(object.readIteratorStats); + } + if (object.requestLatencyStats != null) { + if (typeof object.requestLatencyStats !== "object") + throw TypeError(".google.bigtable.v2.ReadEfficiencyStats.requestLatencyStats: object expected"); + message.requestLatencyStats = $root.google.bigtable.v2.RequestLatencyStats.fromObject(object.requestLatencyStats); + } + return message; + }; + + /** + * Creates a plain object from a ReadEfficiencyStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.ReadEfficiencyStats + * @static + * @param {google.bigtable.v2.ReadEfficiencyStats} message ReadEfficiencyStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadEfficiencyStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.readIteratorStats = null; + object.requestLatencyStats = null; + } + if (message.readIteratorStats != null && message.hasOwnProperty("readIteratorStats")) + object.readIteratorStats = $root.google.bigtable.v2.ReadIteratorStats.toObject(message.readIteratorStats, options); + if (message.requestLatencyStats != null && message.hasOwnProperty("requestLatencyStats")) + object.requestLatencyStats = $root.google.bigtable.v2.RequestLatencyStats.toObject(message.requestLatencyStats, options); + return object; + }; + + /** + * Converts this ReadEfficiencyStats to JSON. + * @function toJSON + * @memberof google.bigtable.v2.ReadEfficiencyStats + * @instance + * @returns {Object.} JSON object + */ + ReadEfficiencyStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadEfficiencyStats + * @function getTypeUrl + * @memberof google.bigtable.v2.ReadEfficiencyStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadEfficiencyStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.ReadEfficiencyStats"; + }; + + return ReadEfficiencyStats; + })(); + + v2.AllReadStats = (function() { + + /** + * Properties of an AllReadStats. + * @memberof google.bigtable.v2 + * @interface IAllReadStats + * @property {google.bigtable.v2.IReadIteratorStats|null} [readIteratorStats] AllReadStats readIteratorStats + * @property {google.bigtable.v2.IRequestLatencyStats|null} [requestLatencyStats] AllReadStats requestLatencyStats + */ + + /** + * Constructs a new AllReadStats. + * @memberof google.bigtable.v2 + * @classdesc Represents an AllReadStats. + * @implements IAllReadStats + * @constructor + * @param {google.bigtable.v2.IAllReadStats=} [properties] Properties to set + */ + function AllReadStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AllReadStats readIteratorStats. + * @member {google.bigtable.v2.IReadIteratorStats|null|undefined} readIteratorStats + * @memberof google.bigtable.v2.AllReadStats + * @instance + */ + AllReadStats.prototype.readIteratorStats = null; + + /** + * AllReadStats requestLatencyStats. + * @member {google.bigtable.v2.IRequestLatencyStats|null|undefined} requestLatencyStats + * @memberof google.bigtable.v2.AllReadStats + * @instance + */ + AllReadStats.prototype.requestLatencyStats = null; + + /** + * Creates a new AllReadStats instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.AllReadStats + * @static + * @param {google.bigtable.v2.IAllReadStats=} [properties] Properties to set + * @returns {google.bigtable.v2.AllReadStats} AllReadStats instance + */ + AllReadStats.create = function create(properties) { + return new AllReadStats(properties); + }; + + /** + * Encodes the specified AllReadStats message. Does not implicitly {@link google.bigtable.v2.AllReadStats.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.AllReadStats + * @static + * @param {google.bigtable.v2.IAllReadStats} message AllReadStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllReadStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readIteratorStats != null && Object.hasOwnProperty.call(message, "readIteratorStats")) + $root.google.bigtable.v2.ReadIteratorStats.encode(message.readIteratorStats, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestLatencyStats != null && Object.hasOwnProperty.call(message, "requestLatencyStats")) + $root.google.bigtable.v2.RequestLatencyStats.encode(message.requestLatencyStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AllReadStats message, length delimited. Does not implicitly {@link google.bigtable.v2.AllReadStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.AllReadStats + * @static + * @param {google.bigtable.v2.IAllReadStats} message AllReadStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllReadStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllReadStats message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.AllReadStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.AllReadStats} AllReadStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllReadStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.AllReadStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.readIteratorStats = $root.google.bigtable.v2.ReadIteratorStats.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestLatencyStats = $root.google.bigtable.v2.RequestLatencyStats.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AllReadStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.AllReadStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.AllReadStats} AllReadStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllReadStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllReadStats message. + * @function verify + * @memberof google.bigtable.v2.AllReadStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllReadStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readIteratorStats != null && message.hasOwnProperty("readIteratorStats")) { + var error = $root.google.bigtable.v2.ReadIteratorStats.verify(message.readIteratorStats); + if (error) + return "readIteratorStats." + error; + } + if (message.requestLatencyStats != null && message.hasOwnProperty("requestLatencyStats")) { + var error = $root.google.bigtable.v2.RequestLatencyStats.verify(message.requestLatencyStats); + if (error) + return "requestLatencyStats." + error; + } + return null; + }; + + /** + * Creates an AllReadStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.AllReadStats + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.AllReadStats} AllReadStats + */ + AllReadStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.AllReadStats) + return object; + var message = new $root.google.bigtable.v2.AllReadStats(); + if (object.readIteratorStats != null) { + if (typeof object.readIteratorStats !== "object") + throw TypeError(".google.bigtable.v2.AllReadStats.readIteratorStats: object expected"); + message.readIteratorStats = $root.google.bigtable.v2.ReadIteratorStats.fromObject(object.readIteratorStats); + } + if (object.requestLatencyStats != null) { + if (typeof object.requestLatencyStats !== "object") + throw TypeError(".google.bigtable.v2.AllReadStats.requestLatencyStats: object expected"); + message.requestLatencyStats = $root.google.bigtable.v2.RequestLatencyStats.fromObject(object.requestLatencyStats); + } + return message; + }; + + /** + * Creates a plain object from an AllReadStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.AllReadStats + * @static + * @param {google.bigtable.v2.AllReadStats} message AllReadStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllReadStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.readIteratorStats = null; + object.requestLatencyStats = null; + } + if (message.readIteratorStats != null && message.hasOwnProperty("readIteratorStats")) + object.readIteratorStats = $root.google.bigtable.v2.ReadIteratorStats.toObject(message.readIteratorStats, options); + if (message.requestLatencyStats != null && message.hasOwnProperty("requestLatencyStats")) + object.requestLatencyStats = $root.google.bigtable.v2.RequestLatencyStats.toObject(message.requestLatencyStats, options); + return object; + }; + + /** + * Converts this AllReadStats to JSON. + * @function toJSON + * @memberof google.bigtable.v2.AllReadStats + * @instance + * @returns {Object.} JSON object + */ + AllReadStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AllReadStats + * @function getTypeUrl + * @memberof google.bigtable.v2.AllReadStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AllReadStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.AllReadStats"; + }; + + return AllReadStats; + })(); + + v2.RequestStats = (function() { + + /** + * Properties of a RequestStats. + * @memberof google.bigtable.v2 + * @interface IRequestStats + * @property {google.bigtable.v2.IReadEfficiencyStats|null} [readEfficiencyStats] RequestStats readEfficiencyStats + * @property {google.bigtable.v2.IAllReadStats|null} [allReadStats] RequestStats allReadStats + */ + + /** + * Constructs a new RequestStats. + * @memberof google.bigtable.v2 + * @classdesc Represents a RequestStats. + * @implements IRequestStats + * @constructor + * @param {google.bigtable.v2.IRequestStats=} [properties] Properties to set + */ + function RequestStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestStats readEfficiencyStats. + * @member {google.bigtable.v2.IReadEfficiencyStats|null|undefined} readEfficiencyStats + * @memberof google.bigtable.v2.RequestStats + * @instance + */ + RequestStats.prototype.readEfficiencyStats = null; + + /** + * RequestStats allReadStats. + * @member {google.bigtable.v2.IAllReadStats|null|undefined} allReadStats + * @memberof google.bigtable.v2.RequestStats + * @instance + */ + RequestStats.prototype.allReadStats = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RequestStats stats. + * @member {"readEfficiencyStats"|"allReadStats"|undefined} stats + * @memberof google.bigtable.v2.RequestStats + * @instance + */ + Object.defineProperty(RequestStats.prototype, "stats", { + get: $util.oneOfGetter($oneOfFields = ["readEfficiencyStats", "allReadStats"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RequestStats instance using the specified properties. + * @function create + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {google.bigtable.v2.IRequestStats=} [properties] Properties to set + * @returns {google.bigtable.v2.RequestStats} RequestStats instance + */ + RequestStats.create = function create(properties) { + return new RequestStats(properties); + }; + + /** + * Encodes the specified RequestStats message. Does not implicitly {@link google.bigtable.v2.RequestStats.verify|verify} messages. + * @function encode + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {google.bigtable.v2.IRequestStats} message RequestStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readEfficiencyStats != null && Object.hasOwnProperty.call(message, "readEfficiencyStats")) + $root.google.bigtable.v2.ReadEfficiencyStats.encode(message.readEfficiencyStats, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.allReadStats != null && Object.hasOwnProperty.call(message, "allReadStats")) + $root.google.bigtable.v2.AllReadStats.encode(message.allReadStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestStats message, length delimited. Does not implicitly {@link google.bigtable.v2.RequestStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {google.bigtable.v2.IRequestStats} message RequestStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestStats message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.v2.RequestStats} RequestStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.v2.RequestStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.readEfficiencyStats = $root.google.bigtable.v2.ReadEfficiencyStats.decode(reader, reader.uint32()); + break; + } + case 2: { + message.allReadStats = $root.google.bigtable.v2.AllReadStats.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.v2.RequestStats} RequestStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestStats message. + * @function verify + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.readEfficiencyStats != null && message.hasOwnProperty("readEfficiencyStats")) { + properties.stats = 1; + { + var error = $root.google.bigtable.v2.ReadEfficiencyStats.verify(message.readEfficiencyStats); + if (error) + return "readEfficiencyStats." + error; + } + } + if (message.allReadStats != null && message.hasOwnProperty("allReadStats")) { + if (properties.stats === 1) + return "stats: multiple values"; + properties.stats = 1; + { + var error = $root.google.bigtable.v2.AllReadStats.verify(message.allReadStats); + if (error) + return "allReadStats." + error; + } + } + return null; + }; + + /** + * Creates a RequestStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.v2.RequestStats} RequestStats + */ + RequestStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.v2.RequestStats) + return object; + var message = new $root.google.bigtable.v2.RequestStats(); + if (object.readEfficiencyStats != null) { + if (typeof object.readEfficiencyStats !== "object") + throw TypeError(".google.bigtable.v2.RequestStats.readEfficiencyStats: object expected"); + message.readEfficiencyStats = $root.google.bigtable.v2.ReadEfficiencyStats.fromObject(object.readEfficiencyStats); + } + if (object.allReadStats != null) { + if (typeof object.allReadStats !== "object") + throw TypeError(".google.bigtable.v2.RequestStats.allReadStats: object expected"); + message.allReadStats = $root.google.bigtable.v2.AllReadStats.fromObject(object.allReadStats); + } + return message; + }; + + /** + * Creates a plain object from a RequestStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {google.bigtable.v2.RequestStats} message RequestStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.readEfficiencyStats != null && message.hasOwnProperty("readEfficiencyStats")) { + object.readEfficiencyStats = $root.google.bigtable.v2.ReadEfficiencyStats.toObject(message.readEfficiencyStats, options); + if (options.oneofs) + object.stats = "readEfficiencyStats"; + } + if (message.allReadStats != null && message.hasOwnProperty("allReadStats")) { + object.allReadStats = $root.google.bigtable.v2.AllReadStats.toObject(message.allReadStats, options); + if (options.oneofs) + object.stats = "allReadStats"; + } + return object; + }; + + /** + * Converts this RequestStats to JSON. + * @function toJSON + * @memberof google.bigtable.v2.RequestStats + * @instance + * @returns {Object.} JSON object + */ + RequestStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RequestStats + * @function getTypeUrl + * @memberof google.bigtable.v2.RequestStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RequestStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.v2.RequestStats"; + }; + + return RequestStats; + })(); + v2.ResponseParams = (function() { /** diff --git a/protos/protos.json b/protos/protos.json index d3cd2f27f..7bdbde64b 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -2840,8 +2840,8 @@ "java_package": "com.google.bigtable.v2", "php_namespace": "Google\\Cloud\\Bigtable\\V2", "ruby_package": "Google::Cloud::Bigtable::V2", - "(google.api.resource_definition).type": "bigtableadmin.googleapis.com/Instance", - "(google.api.resource_definition).pattern": "projects/{project}/instances/{instance}" + "(google.api.resource_definition).type": "bigtableadmin.googleapis.com/Table", + "(google.api.resource_definition).pattern": "projects/{project}/instances/{instance}/tables/{table}" }, "nested": { "Bigtable": { @@ -3144,6 +3144,20 @@ "rowsLimit": { "type": "int64", "id": 4 + }, + "requestStatsView": { + "type": "RequestStatsView", + "id": 6 + } + }, + "nested": { + "RequestStatsView": { + "values": { + "REQUEST_STATS_VIEW_UNSPECIFIED": 0, + "REQUEST_STATS_NONE": 1, + "REQUEST_STATS_EFFICIENCY": 2, + "REQUEST_STATS_FULL": 3 + } } } }, @@ -3157,6 +3171,10 @@ "lastScannedRowKey": { "type": "bytes", "id": 2 + }, + "requestStats": { + "type": "RequestStats", + "id": 3 } }, "nested": { @@ -3877,6 +3895,82 @@ } } }, + "ReadIteratorStats": { + "fields": { + "rowsSeenCount": { + "type": "int64", + "id": 1 + }, + "rowsReturnedCount": { + "type": "int64", + "id": 2 + }, + "cellsSeenCount": { + "type": "int64", + "id": 3 + }, + "cellsReturnedCount": { + "type": "int64", + "id": 4 + }, + "deletesSeenCount": { + "type": "int64", + "id": 5 + } + } + }, + "RequestLatencyStats": { + "fields": { + "frontendServerLatency": { + "type": "google.protobuf.Duration", + "id": 1 + } + } + }, + "ReadEfficiencyStats": { + "fields": { + "readIteratorStats": { + "type": "ReadIteratorStats", + "id": 1 + }, + "requestLatencyStats": { + "type": "RequestLatencyStats", + "id": 2 + } + } + }, + "AllReadStats": { + "fields": { + "readIteratorStats": { + "type": "ReadIteratorStats", + "id": 1 + }, + "requestLatencyStats": { + "type": "RequestLatencyStats", + "id": 2 + } + } + }, + "RequestStats": { + "oneofs": { + "stats": { + "oneof": [ + "readEfficiencyStats", + "allReadStats" + ] + } + }, + "fields": { + "readEfficiencyStats": { + "type": "ReadEfficiencyStats", + "id": 1 + }, + "allReadStats": { + "type": "AllReadStats", + "id": 2 + } + } + }, "ResponseParams": { "oneofs": { "_zoneId": { diff --git a/samples/generated/v2/bigtable.check_and_mutate_row.js b/samples/generated/v2/bigtable.check_and_mutate_row.js index 4db284b16..79809d1b6 100644 --- a/samples/generated/v2/bigtable.check_and_mutate_row.js +++ b/samples/generated/v2/bigtable.check_and_mutate_row.js @@ -33,9 +33,8 @@ function main(tableName, rowKey) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * 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//instances//tables/
`. */ // const tableName = 'abc123' @@ -45,7 +44,8 @@ function main(tableName, rowKey) { */ // const appProfileId = 'abc123' /** - * 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. */ // const rowKey = 'Buffer.from('string')' /** diff --git a/samples/generated/v2/bigtable.mutate_row.js b/samples/generated/v2/bigtable.mutate_row.js index 0b16198c5..3aa250862 100644 --- a/samples/generated/v2/bigtable.mutate_row.js +++ b/samples/generated/v2/bigtable.mutate_row.js @@ -33,8 +33,8 @@ function main(tableName, rowKey, mutations) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * 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//instances//tables/
`. */ // const tableName = 'abc123' @@ -48,9 +48,9 @@ function main(tableName, rowKey, mutations) { */ // const rowKey = 'Buffer.from('string')' /** - * 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. */ // const mutations = 1234 diff --git a/samples/generated/v2/bigtable.mutate_rows.js b/samples/generated/v2/bigtable.mutate_rows.js index 827a3f41a..47eadcf7a 100644 --- a/samples/generated/v2/bigtable.mutate_rows.js +++ b/samples/generated/v2/bigtable.mutate_rows.js @@ -33,7 +33,8 @@ function main(tableName, entries) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * 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. */ // const tableName = 'abc123' /** diff --git a/samples/generated/v2/bigtable.ping_and_warm.js b/samples/generated/v2/bigtable.ping_and_warm.js index 024b656b1..767426131 100644 --- a/samples/generated/v2/bigtable.ping_and_warm.js +++ b/samples/generated/v2/bigtable.ping_and_warm.js @@ -33,8 +33,9 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The unique name of the instance to check permissions for as well as - * respond. Values are of the form `projects//instances/`. + * Required. The unique name of the instance to check permissions for as well + * as respond. Values are of the form + * `projects//instances/`. */ // const name = 'abc123' /** diff --git a/samples/generated/v2/bigtable.read_modify_write_row.js b/samples/generated/v2/bigtable.read_modify_write_row.js index 87a55a8ee..fe4055852 100644 --- a/samples/generated/v2/bigtable.read_modify_write_row.js +++ b/samples/generated/v2/bigtable.read_modify_write_row.js @@ -33,9 +33,8 @@ function main(tableName, rowKey, rules) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * 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//instances//tables/
`. */ // const tableName = 'abc123' @@ -45,13 +44,14 @@ function main(tableName, rowKey, rules) { */ // const appProfileId = 'abc123' /** - * 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. */ // const rowKey = 'Buffer.from('string')' /** - * 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. + * 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. */ // const rules = 1234 diff --git a/samples/generated/v2/bigtable.read_rows.js b/samples/generated/v2/bigtable.read_rows.js index 8c52fce77..67d30dcd2 100644 --- a/samples/generated/v2/bigtable.read_rows.js +++ b/samples/generated/v2/bigtable.read_rows.js @@ -39,8 +39,8 @@ function main(tableName) { */ // const tableName = 'abc123' /** - * 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. */ // const appProfileId = 'abc123' /** @@ -58,6 +58,10 @@ function main(tableName) { * default (zero) is to return all results. */ // const rowsLimit = 1234 + /** + * The view into RequestStats, as described above. + */ + // const requestStatsView = {} // Imports the Bigtable library const {BigtableClient} = require('@google-cloud/bigtable').v2; diff --git a/samples/generated/v2/snippet_metadata.google.bigtable.v2.json b/samples/generated/v2/snippet_metadata.google.bigtable.v2.json index 4ddd8e706..c2bf9849e 100644 --- a/samples/generated/v2/snippet_metadata.google.bigtable.v2.json +++ b/samples/generated/v2/snippet_metadata.google.bigtable.v2.json @@ -22,7 +22,7 @@ "segments": [ { "start": 29, - "end": 81, + "end": 85, "type": "FULL" } ], @@ -50,6 +50,10 @@ { "name": "rows_limit", "type": "TYPE_INT64" + }, + { + "name": "request_stats_view", + "type": ".google.bigtable.v2.ReadRowsRequest.RequestStatsView" } ], "resultType": ".google.bigtable.v2.ReadRowsResponse", @@ -174,7 +178,7 @@ "segments": [ { "start": 29, - "end": 73, + "end": 74, "type": "FULL" } ], @@ -282,7 +286,7 @@ "segments": [ { "start": 29, - "end": 63, + "end": 64, "type": "FULL" } ], diff --git a/src/v2/bigtable_client.ts b/src/v2/bigtable_client.ts index d0323dd05..5de918e95 100644 --- a/src/v2/bigtable_client.ts +++ b/src/v2/bigtable_client.ts @@ -364,8 +364,8 @@ export class BigtableClient { * @param {Object} request * The request object that will be sent. * @param {string} request.tableName - * 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//instances//tables/
`. * @param {string} request.appProfileId * This value specifies routing for replication. If not specified, the @@ -373,9 +373,9 @@ export class BigtableClient { * @param {Buffer} request.rowKey * Required. The key of the row to which the mutation should be applied. * @param {number[]} request.mutations - * 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. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -481,15 +481,15 @@ export class BigtableClient { * @param {Object} request * The request object that will be sent. * @param {string} request.tableName - * 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//instances//tables/
`. * @param {string} request.appProfileId * This value specifies routing for replication. If not specified, the * "default" application profile will be used. * @param {Buffer} request.rowKey - * 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. * @param {google.bigtable.v2.RowFilter} request.predicateFilter * The filter to be applied to the contents of the specified row. Depending * on whether or not any results are yielded, either `true_mutations` or @@ -615,8 +615,9 @@ export class BigtableClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The unique name of the instance to check permissions for as well as - * respond. Values are of the form `projects//instances/`. + * Required. The unique name of the instance to check permissions for as well + * as respond. Values are of the form + * `projects//instances/`. * @param {string} request.appProfileId * This value specifies routing for replication. If not specified, the * "default" application profile will be used. @@ -727,19 +728,19 @@ export class BigtableClient { * @param {Object} request * The request object that will be sent. * @param {string} request.tableName - * 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//instances//tables/
`. * @param {string} request.appProfileId * This value specifies routing for replication. If not specified, the * "default" application profile will be used. * @param {Buffer} request.rowKey - * 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. * @param {number[]} request.rules - * 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. + * 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. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -856,8 +857,8 @@ export class BigtableClient { * Values are of the form * `projects//instances//tables/
`. * @param {string} request.appProfileId - * 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. * @param {google.bigtable.v2.RowSet} request.rows * The row keys and/or ranges to read sequentially. If not specified, reads * from all rows. @@ -867,6 +868,8 @@ export class BigtableClient { * @param {number} request.rowsLimit * The read will stop after committing to N rows' worth of results. The * default (zero) is to return all results. + * @param {google.bigtable.v2.ReadRowsRequest.RequestStatsView} request.requestStatsView + * The view into RequestStats, as described above. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -988,7 +991,8 @@ export class BigtableClient { * @param {Object} request * The request object that will be sent. * @param {string} request.tableName - * 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. * @param {string} request.appProfileId * This value specifies routing for replication. If not specified, the * "default" application profile will be used. diff --git a/src/v2/bigtable_proto_list.json b/src/v2/bigtable_proto_list.json index ec84755b7..866b08e57 100644 --- a/src/v2/bigtable_proto_list.json +++ b/src/v2/bigtable_proto_list.json @@ -1,5 +1,6 @@ [ "../../protos/google/bigtable/v2/bigtable.proto", "../../protos/google/bigtable/v2/data.proto", + "../../protos/google/bigtable/v2/request_stats.proto", "../../protos/google/bigtable/v2/response_params.proto" ]