Skip to content

Commit

Permalink
chore: re-generated to pick up changes from googleapis (#1329)
Browse files Browse the repository at this point in the history
* feat: add RPC Priority request options

PiperOrigin-RevId: 364449524

Source-Author: Google APIs <[email protected]>
Source-Date: Mon Mar 22 17:39:37 2021 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 6598bb829c9e9a534be674649ffd1b4671a821f9
Source-Link: googleapis/googleapis@6598bb8

* feat: add tagging request options

PiperOrigin-RevId: 365498709

Source-Author: Google APIs <[email protected]>
Source-Date: Sun Mar 28 20:54:25 2021 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 6ce40ff8faf68226782f507ca6b2d497a77044de
Source-Link: googleapis/googleapis@6ce40ff
  • Loading branch information
yoshi-automation authored Mar 30, 2021
1 parent 72c7cce commit 2eb37f7
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ message RestoreDatabaseRequest {
// to. If this field is not specified, the restored database will use the same
// encryption configuration as the backup by default, namely
// [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type]
// = `USE_CONFIG_DEFAULT_OR_DATABASE_ENCRYPTION`.
// = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
RestoreDatabaseEncryptionConfig encryption_config = 4
[(google.api.field_behavior) = OPTIONAL];
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Google LLC
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -373,7 +373,7 @@ message Instance {
// either omitted or set to `CREATING`. For
// [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance], the state must be
// either omitted or set to `READY`.
State state = 6;
State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

// Cloud Labels are a flexible and lightweight mechanism for organizing cloud
// resources into groups that reflect a customer's organizational needs and
Expand Down
88 changes: 82 additions & 6 deletions protos/google/spanner/v1/spanner.proto
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,63 @@ message DeleteSessionRequest {
];
}

// Common request options for various APIs.
message RequestOptions {
// The relative priority for requests. Note that priority is not applicable
// for [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction].
//
// The priority acts as a hint to the Cloud Spanner scheduler and does not
// guarantee priority or order of execution. For example:
//
// * Some parts of a write operation always execute at `PRIORITY_HIGH`,
// regardless of the specified priority. This may cause you to see an
// increase in high priority workload even when executing a low priority
// request. This can also potentially cause a priority inversion where a
// lower priority request will be fulfilled ahead of a higher priority
// request.
// * If a transaction contains multiple operations with different priorities,
// Cloud Spanner does not guarantee to process the higher priority
// operations first. There may be other constraints to satisfy, such as
// order of operations.
enum Priority {
// `PRIORITY_UNSPECIFIED` is equivalent to `PRIORITY_HIGH`.
PRIORITY_UNSPECIFIED = 0;

// This specifies that the request is low priority.
PRIORITY_LOW = 1;

// This specifies that the request is medium priority.
PRIORITY_MEDIUM = 2;

// This specifies that the request is high priority.
PRIORITY_HIGH = 3;
}

// Priority for the request.
Priority priority = 1;

// A per-request tag which can be applied to queries or reads, used for
// statistics collection.
// Both request_tag and transaction_tag can be specified for a read or query
// that belongs to a transaction.
// This field is ignored for requests where it's not applicable (e.g.
// CommitRequest).
// `request_tag` must be a valid identifier of the form:
// `[a-zA-Z][a-zA-Z0-9_\-]` between 2 and 64 characters in length
string request_tag = 2;

// A tag used for statistics collection about this transaction.
// Both request_tag and transaction_tag can be specified for a read or query
// that belongs to a transaction.
// The value of transaction_tag should be the same for all requests belonging
// to the same transaction.
// If this request doesn’t belong to any transaction, transaction_tag will be
// ignored.
// `transaction_tag` must be a valid identifier of the format:
// `[a-zA-Z][a-zA-Z0-9_\-]{0,49}`
string transaction_tag = 3;
}

// The request for [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and
// [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql].
message ExecuteSqlRequest {
Expand Down Expand Up @@ -454,15 +511,15 @@ message ExecuteSqlRequest {
// The `optimizer_version` statement hint has precedence over this setting.
string optimizer_version = 1;

// Query optimizer statistics package to use.
// An option to control the selection of optimizer statistics package.
//
// This parameter allows individual queries to use a different query
// optimizer statistics.
// optimizer statistics package.
//
// Specifying `latest` as a value instructs Cloud Spanner to use the latest
// generated statistics package. If not specified, Cloud Spanner uses
// statistics package set at the database level options, or latest if
// the database option is not set.
// the statistics package set at the database level options, or the latest
// package if the database option is not set.
//
// The statistics package requested by the query has to be exempt from
// garbage collection. This can be achieved with the following DDL
Expand All @@ -473,10 +530,10 @@ message ExecuteSqlRequest {
// ```
//
// The list of available statistics packages can be queried from
// `SPANNER_SYS.OPTIMIZER_STATISTICS_PACKAGES`.
// `INFORMATION_SCHEMA.SPANNER_STATISTICS`.
//
// Executing a SQL statement with an invalid optimizer statistics package
// or with statistics package that allows garbage collection fails with
// or with a statistics package that allows garbage collection fails with
// an `INVALID_ARGUMENT` error.
string optimizer_statistics_package = 2;
}
Expand Down Expand Up @@ -576,6 +633,9 @@ message ExecuteSqlRequest {

// Query optimizer configuration to use for the given query.
QueryOptions query_options = 10;

// Common options for this request.
RequestOptions request_options = 11;
}

// The request for [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml].
Expand Down Expand Up @@ -642,6 +702,9 @@ message ExecuteBatchDmlRequest {
// sequence number, the transaction may be aborted. Replays of previously
// handled requests will yield the same response as the first execution.
int64 seqno = 4 [(google.api.field_behavior) = REQUIRED];

// Common options for this request.
RequestOptions request_options = 5;
}

// The response for [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. Contains a list
Expand Down Expand Up @@ -876,6 +939,9 @@ message ReadRequest {
// match for the values of fields common to this message and the
// PartitionReadRequest message used to create this partition_token.
bytes partition_token = 10;

// Common options for this request.
RequestOptions request_options = 11;
}

// The request for [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction].
Expand All @@ -890,6 +956,13 @@ message BeginTransactionRequest {

// Required. Options for the new transaction.
TransactionOptions options = 2 [(google.api.field_behavior) = REQUIRED];

// Common options for this request.
// Priority is ignored for this request. Setting the priority in this
// request_options struct will not do anything. To set the priority for a
// transaction, set it on the reads and writes that are part of this
// transaction instead.
RequestOptions request_options = 3;
}

// The request for [Commit][google.spanner.v1.Spanner.Commit].
Expand Down Expand Up @@ -928,6 +1001,9 @@ message CommitRequest {
// the [CommitResponse][google.spanner.v1.CommitResponse.commit_stats]. Default value is
// `false`.
bool return_commit_stats = 5;

// Common options for this request.
RequestOptions request_options = 6;
}

// The response for [Commit][google.spanner.v1.Spanner.Commit].
Expand Down
2 changes: 1 addition & 1 deletion src/v1/database_admin_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1884,7 +1884,7 @@ export class DatabaseAdminClient {
* to. If this field is not specified, the restored database will use the same
* encryption configuration as the backup by default, namely
* {@link google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type|encryption_type}
* = `USE_CONFIG_DEFAULT_OR_DATABASE_ENCRYPTION`.
* = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
* @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.
Expand Down
18 changes: 18 additions & 0 deletions src/v1/spanner_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,8 @@ export class SpannerClient {
* Required for DML statements. Ignored for queries.
* @param {google.spanner.v1.ExecuteSqlRequest.QueryOptions} request.queryOptions
* Query optimizer configuration to use for the given query.
* @param {google.spanner.v1.RequestOptions} request.requestOptions
* Common options for this request.
* @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.
Expand Down Expand Up @@ -945,6 +947,8 @@ export class SpannerClient {
* transaction. If a request arrives for the first time with an out-of-order
* sequence number, the transaction may be aborted. Replays of previously
* handled requests will yield the same response as the first execution.
* @param {google.spanner.v1.RequestOptions} request.requestOptions
* Common options for this request.
* @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.
Expand Down Expand Up @@ -1082,6 +1086,8 @@ export class SpannerClient {
* previously created using PartitionRead(). There must be an exact
* match for the values of fields common to this message and the
* PartitionReadRequest message used to create this partition_token.
* @param {google.spanner.v1.RequestOptions} request.requestOptions
* Common options for this request.
* @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.
Expand Down Expand Up @@ -1171,6 +1177,12 @@ export class SpannerClient {
* Required. The session in which the transaction runs.
* @param {google.spanner.v1.TransactionOptions} request.options
* Required. Options for the new transaction.
* @param {google.spanner.v1.RequestOptions} request.requestOptions
* Common options for this request.
* Priority is ignored for this request. Setting the priority in this
* request_options struct will not do anything. To set the priority for a
* transaction, set it on the reads and writes that are part of this
* transaction instead.
* @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.
Expand Down Expand Up @@ -1288,6 +1300,8 @@ export class SpannerClient {
* If `true`, then statistics related to the transaction will be included in
* the {@link google.spanner.v1.CommitResponse.commit_stats|CommitResponse}. Default value is
* `false`.
* @param {google.spanner.v1.RequestOptions} request.requestOptions
* Common options for this request.
* @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.
Expand Down Expand Up @@ -1758,6 +1772,8 @@ export class SpannerClient {
* Required for DML statements. Ignored for queries.
* @param {google.spanner.v1.ExecuteSqlRequest.QueryOptions} request.queryOptions
* Query optimizer configuration to use for the given query.
* @param {google.spanner.v1.RequestOptions} request.requestOptions
* Common options for this request.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Stream}
Expand Down Expand Up @@ -1839,6 +1855,8 @@ export class SpannerClient {
* previously created using PartitionRead(). There must be an exact
* match for the values of fields common to this message and the
* PartitionReadRequest message used to create this partition_token.
* @param {google.spanner.v1.RequestOptions} request.requestOptions
* Common options for this request.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Stream}
Expand Down
6 changes: 3 additions & 3 deletions synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/nodejs-spanner.git",
"sha": "31f9fd9255cec763682b03ca4d3a076ef0a247ce"
"sha": "72c7cce0cc00631a0ce46cdb2bf66a0ee48d615b"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "5477122b3e8037a1dc5bc920536158edbd151dc4",
"internalRef": "361273630"
"sha": "6ce40ff8faf68226782f507ca6b2d497a77044de",
"internalRef": "365498709"
}
},
{
Expand Down

0 comments on commit 2eb37f7

Please sign in to comment.