diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ffc82a14..d0c7dea2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/bigtable?activeTab=versions +## [4.4.0](https://github.com/googleapis/nodejs-bigtable/compare/v4.3.0...v4.4.0) (2023-03-01) + + +### Features + +* Add new_partitions field for CloseStream for Cloud Bigtable ChangeStream ([#1247](https://github.com/googleapis/nodejs-bigtable/issues/1247)) ([ecbdb52](https://github.com/googleapis/nodejs-bigtable/commit/ecbdb52ddc920bd493b284fb7d96b359a2f773f9)) + ## [4.3.0](https://github.com/googleapis/nodejs-bigtable/compare/v4.2.0...v4.3.0) (2023-02-10) diff --git a/package.json b/package.json index a9ccf826c..64b553962 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigtable", - "version": "4.3.0", + "version": "4.4.0", "description": "Cloud Bigtable Client Library for Node.js", "keywords": [ "bigtable", diff --git a/protos/google/bigtable/v2/bigtable.proto b/protos/google/bigtable/v2/bigtable.proto index c85e0cfc8..098d17e3e 100644 --- a/protos/google/bigtable/v2/bigtable.proto +++ b/protos/google/bigtable/v2/bigtable.proto @@ -788,17 +788,37 @@ message ReadChangeStreamResponse { } // A message indicating that the client should stop reading from the stream. - // If status is OK and `continuation_tokens` is empty, the stream has finished - // (for example if there was an `end_time` specified). - // If `continuation_tokens` is present, then a change in partitioning requires - // the client to open a new stream for each token to resume reading. + // If status is OK and `continuation_tokens` & `new_partitions` are empty, the + // stream has finished (for example if there was an `end_time` specified). + // If `continuation_tokens` & `new_partitions` are present, then a change in + // partitioning requires the client to open a new stream for each token to + // resume reading. Example: + // [B, D) ends + // | + // v + // new_partitions: [A, C) [C, E) + // continuation_tokens.partitions: [B,C) [C,D) + // ^---^ ^---^ + // ^ ^ + // | | + // | StreamContinuationToken 2 + // | + // StreamContinuationToken 1 + // To read the new partition [A,C), supply the continuation tokens whose + // ranges cover the new partition, for example ContinuationToken[A,B) & + // ContinuationToken[B,C). message CloseStream { // The status of the stream. google.rpc.Status status = 1; - // If non-empty, contains the information needed to start reading the new - // partition(s) that contain segments of this partition's row range. + // If non-empty, contains the information needed to resume reading their + // associated partitions. repeated StreamContinuationToken continuation_tokens = 2; + + // If non-empty, contains the new partitions to start reading from, which + // are related to but not necessarily identical to the partitions for the + // above `continuation_tokens`. + repeated StreamPartition new_partitions = 3; } // The data or control message on the stream. diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 1b0fe2e01..adce7f9af 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -13311,6 +13311,9 @@ export namespace google { /** CloseStream continuationTokens */ continuationTokens?: (google.bigtable.v2.IStreamContinuationToken[]|null); + + /** CloseStream newPartitions */ + newPartitions?: (google.bigtable.v2.IStreamPartition[]|null); } /** Represents a CloseStream. */ @@ -13328,6 +13331,9 @@ export namespace google { /** CloseStream continuationTokens. */ public continuationTokens: google.bigtable.v2.IStreamContinuationToken[]; + /** CloseStream newPartitions. */ + public newPartitions: google.bigtable.v2.IStreamPartition[]; + /** * Creates a new CloseStream instance using the specified properties. * @param [properties] Properties to set diff --git a/protos/protos.js b/protos/protos.js index 4882e79b2..e3ea4ff84 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -31380,6 +31380,7 @@ * @interface ICloseStream * @property {google.rpc.IStatus|null} [status] CloseStream status * @property {Array.|null} [continuationTokens] CloseStream continuationTokens + * @property {Array.|null} [newPartitions] CloseStream newPartitions */ /** @@ -31392,6 +31393,7 @@ */ function CloseStream(properties) { this.continuationTokens = []; + this.newPartitions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31414,6 +31416,14 @@ */ CloseStream.prototype.continuationTokens = $util.emptyArray; + /** + * CloseStream newPartitions. + * @member {Array.} newPartitions + * @memberof google.bigtable.v2.ReadChangeStreamResponse.CloseStream + * @instance + */ + CloseStream.prototype.newPartitions = $util.emptyArray; + /** * Creates a new CloseStream instance using the specified properties. * @function create @@ -31443,6 +31453,9 @@ if (message.continuationTokens != null && message.continuationTokens.length) for (var i = 0; i < message.continuationTokens.length; ++i) $root.google.bigtable.v2.StreamContinuationToken.encode(message.continuationTokens[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newPartitions != null && message.newPartitions.length) + for (var i = 0; i < message.newPartitions.length; ++i) + $root.google.bigtable.v2.StreamPartition.encode(message.newPartitions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -31487,6 +31500,12 @@ message.continuationTokens.push($root.google.bigtable.v2.StreamContinuationToken.decode(reader, reader.uint32())); break; } + case 3: { + if (!(message.newPartitions && message.newPartitions.length)) + message.newPartitions = []; + message.newPartitions.push($root.google.bigtable.v2.StreamPartition.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -31536,6 +31555,15 @@ return "continuationTokens." + error; } } + if (message.newPartitions != null && message.hasOwnProperty("newPartitions")) { + if (!Array.isArray(message.newPartitions)) + return "newPartitions: array expected"; + for (var i = 0; i < message.newPartitions.length; ++i) { + var error = $root.google.bigtable.v2.StreamPartition.verify(message.newPartitions[i]); + if (error) + return "newPartitions." + error; + } + } return null; }; @@ -31566,6 +31594,16 @@ message.continuationTokens[i] = $root.google.bigtable.v2.StreamContinuationToken.fromObject(object.continuationTokens[i]); } } + if (object.newPartitions) { + if (!Array.isArray(object.newPartitions)) + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.CloseStream.newPartitions: array expected"); + message.newPartitions = []; + for (var i = 0; i < object.newPartitions.length; ++i) { + if (typeof object.newPartitions[i] !== "object") + throw TypeError(".google.bigtable.v2.ReadChangeStreamResponse.CloseStream.newPartitions: object expected"); + message.newPartitions[i] = $root.google.bigtable.v2.StreamPartition.fromObject(object.newPartitions[i]); + } + } return message; }; @@ -31582,8 +31620,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.continuationTokens = []; + object.newPartitions = []; + } if (options.defaults) object.status = null; if (message.status != null && message.hasOwnProperty("status")) @@ -31593,6 +31633,11 @@ for (var j = 0; j < message.continuationTokens.length; ++j) object.continuationTokens[j] = $root.google.bigtable.v2.StreamContinuationToken.toObject(message.continuationTokens[j], options); } + if (message.newPartitions && message.newPartitions.length) { + object.newPartitions = []; + for (var j = 0; j < message.newPartitions.length; ++j) + object.newPartitions[j] = $root.google.bigtable.v2.StreamPartition.toObject(message.newPartitions[j], options); + } return object; }; diff --git a/protos/protos.json b/protos/protos.json index 40c274db0..71a826e24 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -3702,6 +3702,11 @@ "rule": "repeated", "type": "StreamContinuationToken", "id": 2 + }, + "newPartitions": { + "rule": "repeated", + "type": "StreamPartition", + "id": 3 } } } diff --git a/protos/v2_test_proxy.proto b/protos/test_proxy.proto similarity index 65% rename from protos/v2_test_proxy.proto rename to protos/test_proxy.proto index 288c68a80..eb8eebe99 100644 --- a/protos/v2_test_proxy.proto +++ b/protos/test_proxy.proto @@ -4,138 +4,205 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// 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 bigtable.client.test; + +package google.bigtable.testproxy; + +import "google/api/client.proto"; import "google/bigtable/v2/bigtable.proto"; import "google/bigtable/v2/data.proto"; import "google/protobuf/duration.proto"; import "google/rpc/status.proto"; + +option go_package = "./testproxypb"; option java_multiple_files = true; option java_package = "com.google.cloud.bigtable.testproxy"; -option go_package = "./testproxypb"; -// The `status` field of response messages always represents an error returned -// by the client binding, e.g. never a problem in either the proxy logic or -// test driver to proxy communication. After receiving a response from the -// proxy, the test driver should always check its `status` field. -// -// [test driver] <--> [test proxy <--> client binding] <--> [Cloud Bigtable] -// ^^^^ -// `status` represents success or errors -// returned from the client binding. -// -// Status propagation design examples, assuming the C++ client: -// -// // For CloudBigtableV2TestProxy.ReadRow -// StatusOr> result = table.ReadRow(row_key, filter); -// -// Set RowResult.status to OK iff result.status() is OK. -// OK is required even if the bool is false, indicating the row wasn't found. -// -// // For CloudBigtableV2TestProxy.BulkMutateRows -// std::vector failed = table.BulkApply(bulk_mutation); -// -// The semantics are less obvious for BulkApply(), because some mutations -// failing doesn't indicate the overall RPC fails. In such case, test proxy -// should disambiguate between RPC failure and individual entry failure, and -// set MutateRowsResult.status according to the overall RPC status. -// -// The final decision regarding semantics must be documented for the -// CloudBigtableV2TestProxy service in this file. + +// Request to test proxy service to create a client object. message CreateClientRequest { + // A unique ID associated with the client object to be created. string client_id = 1; + // The "host:port" address of the data API endpoint (i.e. the backend being - // proxied to). Example: 127.0.0.1:38543 + // proxied to). Example: 127.0.0.1:38543. If you want to connect to a local + // emulator via BIGTABLE_EMULATOR_HOST environment variable, you can use + // "emulator" instead of "host:port" for this field. string data_target = 2; + // The project for all calls on this client. string project_id = 3; + // The instance for all calls on this client. string instance_id = 4; + // Optional app profile for all calls on this client. // Some client bindings allow specifying the app profile on a per-operation // basis. We don't yet support this in the proxy API, but may in the future. string app_profile_id = 5; + // If provided, a custom timeout will be set for each API call conducted by // the created client. Otherwise, the default timeout from the client library // will be used. Note that the override applies to all the methods. google.protobuf.Duration per_operation_timeout = 6; } + +// Response from test proxy service for CreateClientRequest. message CreateClientResponse {} + +// Request to test proxy service to close a client object. message CloseClientRequest { + // The ID of the target client object. string client_id = 1; } + +// Response from test proxy service for CloseClientRequest. message CloseClientResponse {} + +// Request to test proxy service to remove a client object. message RemoveClientRequest { + // The ID of the target client object. string client_id = 1; } + +// Response from test proxy service for RemoveClientRequest. message RemoveClientResponse {} + +// Request to test proxy service to read a row. message ReadRowRequest { + // The ID of the target client object. string client_id = 1; + // The unique name of the table from which to read the row. // Values are of the form // `projects//instances//tables/`. string table_name = 4; + + // The row key of the target row. string row_key = 2; + + // The row filter to be applied to the target row. google.bigtable.v2.RowFilter filter = 3; } + +// Response from test proxy service for ReadRowRequest or +// ReadModifyWriteRowRequest. message RowResult { + // The RPC status from the client binding. google.rpc.Status status = 1; + + // The contents of a single row. google.bigtable.v2.Row row = 2; } + +// Request to test proxy service to read rows. message ReadRowsRequest { + // The ID of the target client object. string client_id = 1; + + // The raw request to the Bigtable server. google.bigtable.v2.ReadRowsRequest request = 2; + // The streaming read can be canceled before all items are seen. // Has no effect if non-positive. int32 cancel_after_rows = 3; } + +// Response from test proxy service for ReadRowsRequest. message RowsResult { + // The RPC status from the client binding. google.rpc.Status status = 1; + + // The contents of rows. repeated google.bigtable.v2.Row row = 2; } + +// Request to test proxy service to mutate a row. message MutateRowRequest { + // The ID of the target client object. string client_id = 1; + + // The raw request to the Bigtable server. google.bigtable.v2.MutateRowRequest request = 2; } + +// Response from test proxy service for MutateRowRequest. message MutateRowResult { + // The RPC status from the client binding. google.rpc.Status status = 1; } + +// Request to test proxy service to mutate rows. message MutateRowsRequest { + // The ID of the target client object. string client_id = 1; + + // The raw request to the Bigtable server. google.bigtable.v2.MutateRowsRequest request = 2; } + +// Response from test proxy service for MutateRowsRequest. message MutateRowsResult { - // Overall RPC status + // The RPC status from the client binding, corresponding to the + // whole operation. google.rpc.Status status = 1; - // To record individual entry failures + + // The results corresponding to the failed rows. repeated google.bigtable.v2.MutateRowsResponse.Entry entry = 2; } + +// Request to test proxy service to check and mutate a row. message CheckAndMutateRowRequest { + // The ID of the target client object. string client_id = 1; + + // The raw request to the Bigtable server. google.bigtable.v2.CheckAndMutateRowRequest request = 2; } + +// Response from test proxy service for CheckAndMutateRowRequest. message CheckAndMutateRowResult { + // The RPC status from the client binding. google.rpc.Status status = 1; + + // The raw response from the Bigtable server. google.bigtable.v2.CheckAndMutateRowResponse result = 2; } + +// Request to test proxy service to sample row keys. message SampleRowKeysRequest { + // The ID of the target client object. string client_id = 1; + + // The raw request to the Bigtable server. google.bigtable.v2.SampleRowKeysRequest request = 2; } + +// Response from test proxy service for SampleRowKeysRequest. message SampleRowKeysResult { + // The RPC status from the client binding. google.rpc.Status status = 1; + + // The raw responses from the Bigtable server. repeated google.bigtable.v2.SampleRowKeysResponse sample = 2; } + +// Request to test proxy service to read modify write a row. message ReadModifyWriteRowRequest { + // The ID of the target client object. string client_id = 1; + + // The raw request to the Bigtable server. google.bigtable.v2.ReadModifyWriteRowRequest request = 2; } + // Note that all RPCs are unary, even when the equivalent client binding call // may be streaming. This is an intentional simplification. // @@ -153,17 +220,23 @@ message ReadModifyWriteRowRequest { // understand that the underlying operation will continue to be executed even // after the deadline expires. service CloudBigtableV2TestProxy { + option (google.api.default_host) = + "bigtable-test-proxy-not-accessible.googleapis.com"; + // Client management: // // Creates a client in the proxy. // Each client has its own dedicated channel(s), and can be used concurrently // and independently with other clients. - rpc CreateClient(CreateClientRequest) returns (CreateClientResponse); + rpc CreateClient(CreateClientRequest) returns (CreateClientResponse) {} + // Closes a client in the proxy, making it not accept new requests. - rpc CloseClient(CloseClientRequest) returns (CloseClientResponse); + rpc CloseClient(CloseClientRequest) returns (CloseClientResponse) {} + // Removes a client in the proxy, making it inaccessible. Client closing // should be done by CloseClient() separately. - rpc RemoveClient(RemoveClientRequest) returns (RemoveClientResponse); + rpc RemoveClient(RemoveClientRequest) returns (RemoveClientResponse) {} + // Bigtable operations: for each operation, you should use the synchronous or // asynchronous variant of the client method based on the `use_async_method` // setting of the client instance. For starters, you can choose to implement @@ -172,18 +245,24 @@ service CloudBigtableV2TestProxy { // Reads a row with the client instance. // The result row may not be present in the response. // Callers should check for it (e.g. calling has_row() in C++). - rpc ReadRow(ReadRowRequest) returns (RowResult); + rpc ReadRow(ReadRowRequest) returns (RowResult) {} + // Reads rows with the client instance. - rpc ReadRows(ReadRowsRequest) returns (RowsResult); + rpc ReadRows(ReadRowsRequest) returns (RowsResult) {} + // Writes a row with the client instance. - rpc MutateRow(MutateRowRequest) returns (MutateRowResult); + rpc MutateRow(MutateRowRequest) returns (MutateRowResult) {} + // Writes multiple rows with the client instance. - rpc BulkMutateRows(MutateRowsRequest) returns (MutateRowsResult); + rpc BulkMutateRows(MutateRowsRequest) returns (MutateRowsResult) {} + // Performs a check-and-mutate-row operation with the client instance. rpc CheckAndMutateRow(CheckAndMutateRowRequest) - returns (CheckAndMutateRowResult); + returns (CheckAndMutateRowResult) {} + // Obtains a row key sampling with the client instance. - rpc SampleRowKeys(SampleRowKeysRequest) returns (SampleRowKeysResult); + rpc SampleRowKeys(SampleRowKeysRequest) returns (SampleRowKeysResult) {} + // Performs a read-modify-write operation with the client. - rpc ReadModifyWriteRow(ReadModifyWriteRowRequest) returns (RowResult); -} + rpc ReadModifyWriteRow(ReadModifyWriteRowRequest) returns (RowResult) {} +} \ No newline at end of file diff --git a/samples/package.json b/samples/package.json index 741578e8b..fffba21c0 100644 --- a/samples/package.json +++ b/samples/package.json @@ -14,7 +14,7 @@ "node": ">=12.0.0" }, "dependencies": { - "@google-cloud/bigtable": "^4.3.0", + "@google-cloud/bigtable": "^4.4.0", "uuid": "^9.0.0", "yargs": "^16.0.0" }, diff --git a/src/v2/bigtable_client.ts b/src/v2/bigtable_client.ts index cfeac33ee..9289276b1 100644 --- a/src/v2/bigtable_client.ts +++ b/src/v2/bigtable_client.ts @@ -393,7 +393,7 @@ export class BigtableClient { * @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. - * The first element of the array is an object representing [MutateRowResponse]{@link google.bigtable.v2.MutateRowResponse}. + * The first element of the array is an object representing {@link google.bigtable.v2.MutateRowResponse | MutateRowResponse}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -524,7 +524,7 @@ export class BigtableClient { * @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. - * The first element of the array is an object representing [CheckAndMutateRowResponse]{@link google.bigtable.v2.CheckAndMutateRowResponse}. + * The first element of the array is an object representing {@link google.bigtable.v2.CheckAndMutateRowResponse | CheckAndMutateRowResponse}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -638,7 +638,7 @@ export class BigtableClient { * @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. - * The first element of the array is an object representing [PingAndWarmResponse]{@link google.bigtable.v2.PingAndWarmResponse}. + * The first element of the array is an object representing {@link google.bigtable.v2.PingAndWarmResponse | PingAndWarmResponse}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -758,7 +758,7 @@ export class BigtableClient { * @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. - * The first element of the array is an object representing [ReadModifyWriteRowResponse]{@link google.bigtable.v2.ReadModifyWriteRowResponse}. + * The first element of the array is an object representing {@link google.bigtable.v2.ReadModifyWriteRowResponse | ReadModifyWriteRowResponse}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -887,7 +887,7 @@ export class BigtableClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} - * An object stream which emits [ReadRowsResponse]{@link google.bigtable.v2.ReadRowsResponse} on 'data' event. + * An object stream which emits {@link google.bigtable.v2.ReadRowsResponse | ReadRowsResponse} on 'data' event. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) * for more details and examples. @@ -951,7 +951,7 @@ export class BigtableClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} - * An object stream which emits [SampleRowKeysResponse]{@link google.bigtable.v2.SampleRowKeysResponse} on 'data' event. + * An object stream which emits {@link google.bigtable.v2.SampleRowKeysResponse | SampleRowKeysResponse} on 'data' event. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) * for more details and examples. @@ -1019,7 +1019,7 @@ export class BigtableClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} - * An object stream which emits [MutateRowsResponse]{@link google.bigtable.v2.MutateRowsResponse} on 'data' event. + * An object stream which emits {@link google.bigtable.v2.MutateRowsResponse | MutateRowsResponse} on 'data' event. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) * for more details and examples. @@ -1085,7 +1085,7 @@ export class BigtableClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} - * An object stream which emits [GenerateInitialChangeStreamPartitionsResponse]{@link google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse} on 'data' event. + * An object stream which emits {@link google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse | GenerateInitialChangeStreamPartitionsResponse} on 'data' event. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) * for more details and examples. @@ -1154,7 +1154,7 @@ export class BigtableClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} - * An object stream which emits [ReadChangeStreamResponse]{@link google.bigtable.v2.ReadChangeStreamResponse} on 'data' event. + * An object stream which emits {@link google.bigtable.v2.ReadChangeStreamResponse | ReadChangeStreamResponse} on 'data' event. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) * for more details and examples. diff --git a/src/v2/bigtable_instance_admin_client.ts b/src/v2/bigtable_instance_admin_client.ts index ef4ff1405..ae6e86caf 100644 --- a/src/v2/bigtable_instance_admin_client.ts +++ b/src/v2/bigtable_instance_admin_client.ts @@ -506,7 +506,7 @@ export class BigtableInstanceAdminClient { * @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. - * The first element of the array is an object representing [Instance]{@link google.bigtable.admin.v2.Instance}. + * The first element of the array is an object representing {@link google.bigtable.admin.v2.Instance | Instance}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -594,7 +594,7 @@ export class BigtableInstanceAdminClient { * @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. - * The first element of the array is an object representing [ListInstancesResponse]{@link google.bigtable.admin.v2.ListInstancesResponse}. + * The first element of the array is an object representing {@link google.bigtable.admin.v2.ListInstancesResponse | ListInstancesResponse}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -709,7 +709,7 @@ export class BigtableInstanceAdminClient { * @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. - * The first element of the array is an object representing [Instance]{@link google.bigtable.admin.v2.Instance}. + * The first element of the array is an object representing {@link google.bigtable.admin.v2.Instance | Instance}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -793,7 +793,7 @@ export class BigtableInstanceAdminClient { * @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. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -879,7 +879,7 @@ export class BigtableInstanceAdminClient { * @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. - * The first element of the array is an object representing [Cluster]{@link google.bigtable.admin.v2.Cluster}. + * The first element of the array is an object representing {@link google.bigtable.admin.v2.Cluster | Cluster}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -967,7 +967,7 @@ export class BigtableInstanceAdminClient { * @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. - * The first element of the array is an object representing [ListClustersResponse]{@link google.bigtable.admin.v2.ListClustersResponse}. + * The first element of the array is an object representing {@link google.bigtable.admin.v2.ListClustersResponse | ListClustersResponse}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -1053,7 +1053,7 @@ export class BigtableInstanceAdminClient { * @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. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -1149,7 +1149,7 @@ export class BigtableInstanceAdminClient { * @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. - * The first element of the array is an object representing [AppProfile]{@link google.bigtable.admin.v2.AppProfile}. + * The first element of the array is an object representing {@link google.bigtable.admin.v2.AppProfile | AppProfile}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -1241,7 +1241,7 @@ export class BigtableInstanceAdminClient { * @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. - * The first element of the array is an object representing [AppProfile]{@link google.bigtable.admin.v2.AppProfile}. + * The first element of the array is an object representing {@link google.bigtable.admin.v2.AppProfile | AppProfile}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -1329,7 +1329,7 @@ export class BigtableInstanceAdminClient { * @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. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -1425,7 +1425,7 @@ export class BigtableInstanceAdminClient { * @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. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -1521,7 +1521,7 @@ export class BigtableInstanceAdminClient { * @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. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -1610,7 +1610,7 @@ export class BigtableInstanceAdminClient { * @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. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -2618,7 +2618,7 @@ export class BigtableInstanceAdminClient { * @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. - * The first element of the array is Array of [AppProfile]{@link google.bigtable.admin.v2.AppProfile}. + * The first element of the array is Array of {@link google.bigtable.admin.v2.AppProfile | AppProfile}. * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. * Note that it can affect your quota. @@ -2728,7 +2728,7 @@ export class BigtableInstanceAdminClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} - * An object stream which emits an object representing [AppProfile]{@link google.bigtable.admin.v2.AppProfile} on 'data' event. + * An object stream which emits an object representing {@link google.bigtable.admin.v2.AppProfile | AppProfile} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. * We recommend using `listAppProfilesAsync()` @@ -2788,7 +2788,7 @@ export class BigtableInstanceAdminClient { * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing - * [AppProfile]{@link google.bigtable.admin.v2.AppProfile}. The API will be called under the hood as needed, once per the page, + * {@link google.bigtable.admin.v2.AppProfile | AppProfile}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) @@ -2851,7 +2851,7 @@ export class BigtableInstanceAdminClient { * @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. - * The first element of the array is Array of [HotTablet]{@link google.bigtable.admin.v2.HotTablet}. + * The first element of the array is Array of {@link google.bigtable.admin.v2.HotTablet | HotTablet}. * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. * Note that it can affect your quota. @@ -2968,7 +2968,7 @@ export class BigtableInstanceAdminClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} - * An object stream which emits an object representing [HotTablet]{@link google.bigtable.admin.v2.HotTablet} on 'data' event. + * An object stream which emits an object representing {@link google.bigtable.admin.v2.HotTablet | HotTablet} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. * We recommend using `listHotTabletsAsync()` @@ -3035,7 +3035,7 @@ export class BigtableInstanceAdminClient { * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing - * [HotTablet]{@link google.bigtable.admin.v2.HotTablet}. The API will be called under the hood as needed, once per the page, + * {@link google.bigtable.admin.v2.HotTablet | HotTablet}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) diff --git a/src/v2/bigtable_table_admin_client.ts b/src/v2/bigtable_table_admin_client.ts index 35d1de6d0..7e86e21ae 100644 --- a/src/v2/bigtable_table_admin_client.ts +++ b/src/v2/bigtable_table_admin_client.ts @@ -538,7 +538,7 @@ export class BigtableTableAdminClient { * @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. - * The first element of the array is an object representing [Table]{@link google.bigtable.admin.v2.Table}. + * The first element of the array is an object representing {@link google.bigtable.admin.v2.Table | Table}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -628,7 +628,7 @@ export class BigtableTableAdminClient { * @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. - * The first element of the array is an object representing [Table]{@link google.bigtable.admin.v2.Table}. + * The first element of the array is an object representing {@link google.bigtable.admin.v2.Table | Table}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -713,7 +713,7 @@ export class BigtableTableAdminClient { * @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. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -808,7 +808,7 @@ export class BigtableTableAdminClient { * @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. - * The first element of the array is an object representing [Table]{@link google.bigtable.admin.v2.Table}. + * The first element of the array is an object representing {@link google.bigtable.admin.v2.Table | Table}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -908,7 +908,7 @@ export class BigtableTableAdminClient { * @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. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -998,7 +998,7 @@ export class BigtableTableAdminClient { * @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. - * The first element of the array is an object representing [GenerateConsistencyTokenResponse]{@link google.bigtable.admin.v2.GenerateConsistencyTokenResponse}. + * The first element of the array is an object representing {@link google.bigtable.admin.v2.GenerateConsistencyTokenResponse | GenerateConsistencyTokenResponse}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -1105,7 +1105,7 @@ export class BigtableTableAdminClient { * @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. - * The first element of the array is an object representing [CheckConsistencyResponse]{@link google.bigtable.admin.v2.CheckConsistencyResponse}. + * The first element of the array is an object representing {@link google.bigtable.admin.v2.CheckConsistencyResponse | CheckConsistencyResponse}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -1204,7 +1204,7 @@ export class BigtableTableAdminClient { * @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. - * The first element of the array is an object representing [Snapshot]{@link google.bigtable.admin.v2.Snapshot}. + * The first element of the array is an object representing {@link google.bigtable.admin.v2.Snapshot | Snapshot}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -1297,7 +1297,7 @@ export class BigtableTableAdminClient { * @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. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -1384,7 +1384,7 @@ export class BigtableTableAdminClient { * @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. - * The first element of the array is an object representing [Backup]{@link google.bigtable.admin.v2.Backup}. + * The first element of the array is an object representing {@link google.bigtable.admin.v2.Backup | Backup}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -1476,7 +1476,7 @@ export class BigtableTableAdminClient { * @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. - * The first element of the array is an object representing [Backup]{@link google.bigtable.admin.v2.Backup}. + * The first element of the array is an object representing {@link google.bigtable.admin.v2.Backup | Backup}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -1563,7 +1563,7 @@ export class BigtableTableAdminClient { * @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. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -1654,7 +1654,7 @@ export class BigtableTableAdminClient { * @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. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -1750,7 +1750,7 @@ export class BigtableTableAdminClient { * @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. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -1839,7 +1839,7 @@ export class BigtableTableAdminClient { * @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. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. @@ -2859,7 +2859,7 @@ export class BigtableTableAdminClient { * @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. - * The first element of the array is Array of [Table]{@link google.bigtable.admin.v2.Table}. + * The first element of the array is Array of {@link google.bigtable.admin.v2.Table | Table}. * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. * Note that it can affect your quota. @@ -2963,7 +2963,7 @@ export class BigtableTableAdminClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} - * An object stream which emits an object representing [Table]{@link google.bigtable.admin.v2.Table} on 'data' event. + * An object stream which emits an object representing {@link google.bigtable.admin.v2.Table | Table} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. * We recommend using `listTablesAsync()` @@ -3023,7 +3023,7 @@ export class BigtableTableAdminClient { * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing - * [Table]{@link google.bigtable.admin.v2.Table}. The API will be called under the hood as needed, once per the page, + * {@link google.bigtable.admin.v2.Table | Table}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) @@ -3077,7 +3077,7 @@ export class BigtableTableAdminClient { * @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. - * The first element of the array is Array of [Snapshot]{@link google.bigtable.admin.v2.Snapshot}. + * The first element of the array is Array of {@link google.bigtable.admin.v2.Snapshot | Snapshot}. * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. * Note that it can affect your quota. @@ -3174,7 +3174,7 @@ export class BigtableTableAdminClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} - * An object stream which emits an object representing [Snapshot]{@link google.bigtable.admin.v2.Snapshot} on 'data' event. + * An object stream which emits an object representing {@link google.bigtable.admin.v2.Snapshot | Snapshot} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. * We recommend using `listSnapshotsAsync()` @@ -3227,7 +3227,7 @@ export class BigtableTableAdminClient { * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing - * [Snapshot]{@link google.bigtable.admin.v2.Snapshot}. The API will be called under the hood as needed, once per the page, + * {@link google.bigtable.admin.v2.Snapshot | Snapshot}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) @@ -3332,7 +3332,7 @@ export class BigtableTableAdminClient { * @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. - * The first element of the array is Array of [Backup]{@link google.bigtable.admin.v2.Backup}. + * The first element of the array is Array of {@link google.bigtable.admin.v2.Backup | Backup}. * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. * Note that it can affect your quota. @@ -3485,7 +3485,7 @@ export class BigtableTableAdminClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} - * An object stream which emits an object representing [Backup]{@link google.bigtable.admin.v2.Backup} on 'data' event. + * An object stream which emits an object representing {@link google.bigtable.admin.v2.Backup | Backup} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. * We recommend using `listBackupsAsync()` @@ -3594,7 +3594,7 @@ export class BigtableTableAdminClient { * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing - * [Backup]{@link google.bigtable.admin.v2.Backup}. The API will be called under the hood as needed, once per the page, + * {@link google.bigtable.admin.v2.Backup | Backup}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) diff --git a/testproxy/index.js b/testproxy/index.js index 0ec9f554f..1caccc305 100644 --- a/testproxy/index.js +++ b/testproxy/index.js @@ -25,7 +25,7 @@ const GAX_PROTOS_DIR = resolve( '../protos' ); const PROTOS_DIR = resolve(__dirname, '../protos'); -const PROTO_PATH = resolve(PROTOS_DIR, 'v2_test_proxy.proto'); +const PROTO_PATH = resolve(PROTOS_DIR, 'test_proxy.proto'); const port = parseInt(process.env.PORT, 10) || 9999; async function loadDescriptor() { @@ -56,7 +56,8 @@ function startServer(service) { async function main() { const descriptor = await loadDescriptor(); - const {service} = descriptor.bigtable.client.test.CloudBigtableV2TestProxy; + const {service} = + descriptor.google.bigtable.testproxy.CloudBigtableV2TestProxy; await startServer(service); } diff --git a/testproxy/services/bulk-mutate-rows.js b/testproxy/services/bulk-mutate-rows.js index 4dcf8ce40..73df6394b 100644 --- a/testproxy/services/bulk-mutate-rows.js +++ b/testproxy/services/bulk-mutate-rows.js @@ -14,38 +14,44 @@ 'use strict'; const grpc = require('@grpc/grpc-js'); -const {BigtableClient} = require('../../build/src/index.js').v2; const normalizeCallback = require('./utils/normalize-callback.js'); +const getTableInfo = require('./utils/get-table-info'); const bulkMutateRows = ({clientMap}) => normalizeCallback(async rawRequest => { const {request} = rawRequest; const {request: mutateRequest} = request; - const {appProfileId, entries, tableName} = mutateRequest; + const {entries, tableName} = mutateRequest; const {clientId} = request; const bigtable = clientMap.get(clientId); - const client = new BigtableClient(bigtable.options.BigtableClient); - const result = await new Promise((res, rej) => { - const response = {entries: []}; - client - .mutateRows({ - appProfileId, - entries, - tableName, - }) - .on('data', data => { - response.entries = [...data.entries]; - }) - .on('error', rej) - .on('end', () => res(response)); - }); - - return { - status: {code: grpc.status.OK, details: []}, - entry: result.entries, - }; + const table = getTableInfo(bigtable, tableName); + try { + const mutateOptions = { + rawMutation: true, + }; + await table.mutate(entries, mutateOptions); + return { + status: {code: grpc.status.OK, details: []}, + entry: [], + }; + } catch (error) { + if (error.name === 'PartialFailureError') { + return { + status: error, + entry: Array.from(error.errors.entries()).map(([index, entry]) => ({ + index: index + 1, + status: entry, + })), + }; + } else { + return { + status: error, + entry: [], + }; + } + } }); module.exports = bulkMutateRows;