Skip to content

Commit 6ce40ff

Browse files
Google APIscopybara-github
authored andcommitted
feat: add tagging request options
PiperOrigin-RevId: 365498709
1 parent c3918fe commit 6ce40ff

3 files changed

Lines changed: 30 additions & 9 deletions

File tree

google/spanner/admin/database/v1/spanner_database_admin.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ message RestoreDatabaseRequest {
736736
// to. If this field is not specified, the restored database will use the same
737737
// encryption configuration as the backup by default, namely
738738
// [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type]
739-
// = `USE_CONFIG_DEFAULT_OR_DATABASE_ENCRYPTION`.
739+
// = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
740740
RestoreDatabaseEncryptionConfig encryption_config = 4
741741
[(google.api.field_behavior) = OPTIONAL];
742742
}

google/spanner/admin/instance/v1/spanner_instance_admin.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -373,7 +373,7 @@ message Instance {
373373
// either omitted or set to `CREATING`. For
374374
// [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance], the state must be
375375
// either omitted or set to `READY`.
376-
State state = 6;
376+
State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
377377

378378
// Cloud Labels are a flexible and lightweight mechanism for organizing cloud
379379
// resources into groups that reflect a customer's organizational needs and

google/spanner/v1/spanner.proto

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,27 @@ message RequestOptions {
459459

460460
// Priority for the request.
461461
Priority priority = 1;
462+
463+
// A per-request tag which can be applied to queries or reads, used for
464+
// statistics collection.
465+
// Both request_tag and transaction_tag can be specified for a read or query
466+
// that belongs to a transaction.
467+
// This field is ignored for requests where it's not applicable (e.g.
468+
// CommitRequest).
469+
// `request_tag` must be a valid identifier of the form:
470+
// `[a-zA-Z][a-zA-Z0-9_\-]` between 2 and 64 characters in length
471+
string request_tag = 2;
472+
473+
// A tag used for statistics collection about this transaction.
474+
// Both request_tag and transaction_tag can be specified for a read or query
475+
// that belongs to a transaction.
476+
// The value of transaction_tag should be the same for all requests belonging
477+
// to the same transaction.
478+
// If this request doesn’t belong to any transaction, transaction_tag will be
479+
// ignored.
480+
// `transaction_tag` must be a valid identifier of the format:
481+
// `[a-zA-Z][a-zA-Z0-9_\-]{0,49}`
482+
string transaction_tag = 3;
462483
}
463484

464485
// The request for [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and
@@ -490,15 +511,15 @@ message ExecuteSqlRequest {
490511
// The `optimizer_version` statement hint has precedence over this setting.
491512
string optimizer_version = 1;
492513

493-
// Query optimizer statistics package to use.
514+
// An option to control the selection of optimizer statistics package.
494515
//
495516
// This parameter allows individual queries to use a different query
496-
// optimizer statistics.
517+
// optimizer statistics package.
497518
//
498519
// Specifying `latest` as a value instructs Cloud Spanner to use the latest
499520
// generated statistics package. If not specified, Cloud Spanner uses
500-
// statistics package set at the database level options, or latest if
501-
// the database option is not set.
521+
// the statistics package set at the database level options, or the latest
522+
// package if the database option is not set.
502523
//
503524
// The statistics package requested by the query has to be exempt from
504525
// garbage collection. This can be achieved with the following DDL
@@ -509,10 +530,10 @@ message ExecuteSqlRequest {
509530
// ```
510531
//
511532
// The list of available statistics packages can be queried from
512-
// `SPANNER_SYS.OPTIMIZER_STATISTICS_PACKAGES`.
533+
// `INFORMATION_SCHEMA.SPANNER_STATISTICS`.
513534
//
514535
// Executing a SQL statement with an invalid optimizer statistics package
515-
// or with statistics package that allows garbage collection fails with
536+
// or with a statistics package that allows garbage collection fails with
516537
// an `INVALID_ARGUMENT` error.
517538
string optimizer_statistics_package = 2;
518539
}

0 commit comments

Comments
 (0)