@google-cloud/spanner 8.3.1 → 8.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +70 -3
- package/build/protos/google/spanner/v1/location.proto +388 -0
- package/build/protos/google/spanner/v1/mutation.proto +41 -0
- package/build/protos/google/spanner/v1/query_plan.proto +25 -0
- package/build/protos/google/spanner/v1/result_set.proto +9 -0
- package/build/protos/google/spanner/v1/spanner.proto +35 -6
- package/build/protos/google/spanner/v1/transaction.proto +4 -2
- package/build/protos/protos.d.ts +2344 -619
- package/build/protos/protos.js +7358 -2472
- package/build/protos/protos.json +513 -72
- package/build/src/codec.d.ts +1 -0
- package/build/src/codec.js +6 -0
- package/build/src/multiplexed-session.d.ts +15 -24
- package/build/src/multiplexed-session.js +71 -78
- package/build/src/session-factory.js +7 -12
- package/build/src/table.d.ts +3 -1
- package/build/src/transaction.js +15 -2
- package/build/src/v1/database_admin_client.js +1 -1
- package/build/src/v1/spanner_client.d.ts +32 -4
- package/build/src/v1/spanner_client.js +15 -1
- package/build/src/v1/spanner_executor_proxy_client.js +1 -1
- package/build/src/v1/spanner_executor_proxy_proto_list.json +1 -0
- package/build/src/v1/spanner_proto_list.json +1 -0
- package/package.json +3 -3
|
@@ -933,12 +933,25 @@ message AutoscalingConfig {
|
|
|
933
933
|
|
|
934
934
|
// The autoscaling targets for an instance.
|
|
935
935
|
message AutoscalingTargets {
|
|
936
|
-
//
|
|
936
|
+
// Optional. The target high priority cpu utilization percentage that the
|
|
937
937
|
// autoscaler should be trying to achieve for the instance. This number is
|
|
938
938
|
// on a scale from 0 (no utilization) to 100 (full utilization). The valid
|
|
939
|
-
// range is [10, 90] inclusive.
|
|
939
|
+
// range is [10, 90] inclusive. If not specified or set to 0, the autoscaler
|
|
940
|
+
// skips scaling based on high priority CPU utilization.
|
|
940
941
|
int32 high_priority_cpu_utilization_percent = 1
|
|
941
|
-
[(google.api.field_behavior) =
|
|
942
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
943
|
+
|
|
944
|
+
// Optional. The target total CPU utilization percentage that the autoscaler
|
|
945
|
+
// should be trying to achieve for the instance. This number is on a scale
|
|
946
|
+
// from 0 (no utilization) to 100 (full utilization). The valid range is
|
|
947
|
+
// [10, 90] inclusive. If not specified or set to 0, the autoscaler skips
|
|
948
|
+
// scaling based on total CPU utilization. If both
|
|
949
|
+
// `high_priority_cpu_utilization_percent` and
|
|
950
|
+
// `total_cpu_utilization_percent` are specified, the autoscaler provisions
|
|
951
|
+
// the larger of the two required compute capacities to satisfy both
|
|
952
|
+
// targets.
|
|
953
|
+
int32 total_cpu_utilization_percent = 4
|
|
954
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
942
955
|
|
|
943
956
|
// Required. The target storage utilization percentage that the autoscaler
|
|
944
957
|
// should be trying to achieve for the instance. This number is on a scale
|
|
@@ -966,6 +979,60 @@ message AutoscalingConfig {
|
|
|
966
979
|
// configuration for the selected replicas.
|
|
967
980
|
int32 autoscaling_target_high_priority_cpu_utilization_percent = 2
|
|
968
981
|
[(google.api.field_behavior) = OPTIONAL];
|
|
982
|
+
|
|
983
|
+
// Optional. If specified, overrides the
|
|
984
|
+
// autoscaling target `total_cpu_utilization_percent`
|
|
985
|
+
// in the top-level autoscaling configuration for the selected replicas.
|
|
986
|
+
int32 autoscaling_target_total_cpu_utilization_percent = 4
|
|
987
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
988
|
+
|
|
989
|
+
// Optional. If true, disables high priority CPU autoscaling for the
|
|
990
|
+
// selected replicas and ignores
|
|
991
|
+
// [high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.high_priority_cpu_utilization_percent]
|
|
992
|
+
// in the top-level autoscaling configuration.
|
|
993
|
+
//
|
|
994
|
+
// When setting this field to true, setting
|
|
995
|
+
// [autoscaling_target_high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_high_priority_cpu_utilization_percent]
|
|
996
|
+
// field to a non-zero value for the same replica is not supported.
|
|
997
|
+
//
|
|
998
|
+
// If false, the
|
|
999
|
+
// [autoscaling_target_high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_high_priority_cpu_utilization_percent]
|
|
1000
|
+
// field in the replica will be used if set to a non-zero value.
|
|
1001
|
+
// Otherwise, the
|
|
1002
|
+
// [high_priority_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.high_priority_cpu_utilization_percent]
|
|
1003
|
+
// field in the top-level autoscaling configuration will be used.
|
|
1004
|
+
//
|
|
1005
|
+
// Setting both
|
|
1006
|
+
// [disable_high_priority_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_high_priority_cpu_autoscaling]
|
|
1007
|
+
// and
|
|
1008
|
+
// [disable_total_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_total_cpu_autoscaling]
|
|
1009
|
+
// to true for the same replica is not supported.
|
|
1010
|
+
bool disable_high_priority_cpu_autoscaling = 5
|
|
1011
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
1012
|
+
|
|
1013
|
+
// Optional. If true, disables total CPU autoscaling for the selected
|
|
1014
|
+
// replicas and ignores
|
|
1015
|
+
// [total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.total_cpu_utilization_percent]
|
|
1016
|
+
// in the top-level autoscaling configuration.
|
|
1017
|
+
//
|
|
1018
|
+
// When setting this field to true, setting
|
|
1019
|
+
// [autoscaling_target_total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_total_cpu_utilization_percent]
|
|
1020
|
+
// field to a non-zero value for the same replica is not supported.
|
|
1021
|
+
//
|
|
1022
|
+
// If false, the
|
|
1023
|
+
// [autoscaling_target_total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscaling_target_total_cpu_utilization_percent]
|
|
1024
|
+
// field in the replica will be used if set to a non-zero value.
|
|
1025
|
+
// Otherwise, the
|
|
1026
|
+
// [total_cpu_utilization_percent][google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.total_cpu_utilization_percent]
|
|
1027
|
+
// field in the top-level autoscaling configuration will be used.
|
|
1028
|
+
//
|
|
1029
|
+
// Setting both
|
|
1030
|
+
// [disable_high_priority_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_high_priority_cpu_autoscaling]
|
|
1031
|
+
// and
|
|
1032
|
+
// [disable_total_cpu_autoscaling][google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.disable_total_cpu_autoscaling]
|
|
1033
|
+
// to true for the same replica is not supported.
|
|
1034
|
+
bool disable_total_cpu_autoscaling = 6
|
|
1035
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
969
1036
|
}
|
|
970
1037
|
|
|
971
1038
|
// Required. Selects the replicas to which this AsymmetricAutoscalingOption
|
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
// Copyright 2025 Google LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package google.spanner.v1;
|
|
18
|
+
|
|
19
|
+
import "google/protobuf/struct.proto";
|
|
20
|
+
import "google/spanner/v1/type.proto";
|
|
21
|
+
|
|
22
|
+
option csharp_namespace = "Google.Cloud.Spanner.V1";
|
|
23
|
+
option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb";
|
|
24
|
+
option java_multiple_files = true;
|
|
25
|
+
option java_outer_classname = "LocationProto";
|
|
26
|
+
option java_package = "com.google.spanner.v1";
|
|
27
|
+
option php_namespace = "Google\\Cloud\\Spanner\\V1";
|
|
28
|
+
option ruby_package = "Google::Cloud::Spanner::V1";
|
|
29
|
+
|
|
30
|
+
// A `Range` represents a range of keys in a database. The keys themselves
|
|
31
|
+
// are encoded in "sortable string format", also known as ssformat. Consult
|
|
32
|
+
// Spanner's open source client libraries for details on the encoding.
|
|
33
|
+
//
|
|
34
|
+
// Each range represents a contiguous range of rows, possibly from multiple
|
|
35
|
+
// tables/indexes. Each range is associated with a single paxos group (known as
|
|
36
|
+
// a "group" throughout this API), a split (which names the exact range within
|
|
37
|
+
// the group), and a generation that can be used to determine whether a given
|
|
38
|
+
// `Range` represents a newer or older location for the key range.
|
|
39
|
+
message Range {
|
|
40
|
+
// The start key of the range, inclusive. Encoded in "sortable string format"
|
|
41
|
+
// (ssformat).
|
|
42
|
+
bytes start_key = 1;
|
|
43
|
+
|
|
44
|
+
// The limit key of the range, exclusive. Encoded in "sortable string format"
|
|
45
|
+
// (ssformat).
|
|
46
|
+
bytes limit_key = 2;
|
|
47
|
+
|
|
48
|
+
// The UID of the paxos group where this range is stored. UIDs are unique
|
|
49
|
+
// within the database. References `Group.group_uid`.
|
|
50
|
+
uint64 group_uid = 3;
|
|
51
|
+
|
|
52
|
+
// A group can store multiple ranges of keys. Each key range is named by an
|
|
53
|
+
// ID (the split ID). Within a group, split IDs are unique. The `split_id`
|
|
54
|
+
// names the exact split in `group_uid` where this range is stored.
|
|
55
|
+
uint64 split_id = 4;
|
|
56
|
+
|
|
57
|
+
// `generation` indicates the freshness of the range information contained
|
|
58
|
+
// in this proto. Generations can be compared lexicographically; if generation
|
|
59
|
+
// A is greater than generation B, then the `Range` corresponding to A is
|
|
60
|
+
// newer than the `Range` corresponding to B, and should be used
|
|
61
|
+
// preferentially.
|
|
62
|
+
bytes generation = 5;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// A `Tablet` represents a single replica of a `Group`. A tablet is served by a
|
|
66
|
+
// single server at a time, and can move between servers due to server death or
|
|
67
|
+
// simply load balancing.
|
|
68
|
+
message Tablet {
|
|
69
|
+
// Indicates the role of the tablet.
|
|
70
|
+
enum Role {
|
|
71
|
+
// Not specified.
|
|
72
|
+
ROLE_UNSPECIFIED = 0;
|
|
73
|
+
|
|
74
|
+
// The tablet can perform reads and (if elected leader) writes.
|
|
75
|
+
READ_WRITE = 1;
|
|
76
|
+
|
|
77
|
+
// The tablet can only perform reads.
|
|
78
|
+
READ_ONLY = 2;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// The UID of the tablet, unique within the database. Matches the
|
|
82
|
+
// `tablet_uids` and `leader_tablet_uid` fields in `Group`.
|
|
83
|
+
uint64 tablet_uid = 1;
|
|
84
|
+
|
|
85
|
+
// The address of the server that is serving this tablet -- either an IP
|
|
86
|
+
// address or DNS hostname and a port number.
|
|
87
|
+
string server_address = 2;
|
|
88
|
+
|
|
89
|
+
// Where this tablet is located. This is the name of a Google Cloud region,
|
|
90
|
+
// such as "us-central1".
|
|
91
|
+
string location = 3;
|
|
92
|
+
|
|
93
|
+
// The role of the tablet.
|
|
94
|
+
Role role = 4;
|
|
95
|
+
|
|
96
|
+
// `incarnation` indicates the freshness of the tablet information contained
|
|
97
|
+
// in this proto. Incarnations can be compared lexicographically; if
|
|
98
|
+
// incarnation A is greater than incarnation B, then the `Tablet`
|
|
99
|
+
// corresponding to A is newer than the `Tablet` corresponding to B, and
|
|
100
|
+
// should be used preferentially.
|
|
101
|
+
bytes incarnation = 5;
|
|
102
|
+
|
|
103
|
+
// Distances help the client pick the closest tablet out of the list of
|
|
104
|
+
// tablets for a given request. Tablets with lower distances should generally
|
|
105
|
+
// be preferred. Tablets with the same distance are approximately equally
|
|
106
|
+
// close; the client can choose arbitrarily.
|
|
107
|
+
//
|
|
108
|
+
// Distances do not correspond precisely to expected latency, geographical
|
|
109
|
+
// distance, or anything else. Distances should be compared only between
|
|
110
|
+
// tablets of the same group; they are not meaningful between different
|
|
111
|
+
// groups.
|
|
112
|
+
//
|
|
113
|
+
// A value of zero indicates that the tablet may be in the same zone as
|
|
114
|
+
// the client, and have minimum network latency. A value less than or equal to
|
|
115
|
+
// five indicates that the tablet is thought to be in the same region as the
|
|
116
|
+
// client, and may have a few milliseconds of network latency. Values greater
|
|
117
|
+
// than five are most likely in a different region, with non-trivial network
|
|
118
|
+
// latency.
|
|
119
|
+
//
|
|
120
|
+
// Clients should use the following algorithm:
|
|
121
|
+
// * If the request is using a directed read, eliminate any tablets that
|
|
122
|
+
// do not match the directed read's target zone and/or replica type.
|
|
123
|
+
// * (Read-write transactions only) Choose leader tablet if it has an
|
|
124
|
+
// distance <=5.
|
|
125
|
+
// * Group and sort tablets by distance. Choose a random
|
|
126
|
+
// tablet with the lowest distance. If the request
|
|
127
|
+
// is not a directed read, only consider replicas with distances <=5.
|
|
128
|
+
// * Send the request to the fallback endpoint.
|
|
129
|
+
//
|
|
130
|
+
// The tablet picked by this algorithm may be skipped, either because it is
|
|
131
|
+
// marked as `skip` by the server or because the corresponding server is
|
|
132
|
+
// unreachable, flow controlled, etc. Skipped tablets should be added to the
|
|
133
|
+
// `skipped_tablet_uid` field in `RoutingHint`; the algorithm above should
|
|
134
|
+
// then be re-run without including the skipped tablet(s) to pick the next
|
|
135
|
+
// best tablet.
|
|
136
|
+
uint32 distance = 6;
|
|
137
|
+
|
|
138
|
+
// If true, the tablet should not be chosen by the client. Typically, this
|
|
139
|
+
// signals that the tablet is unhealthy in some way. Tablets with `skip`
|
|
140
|
+
// set to true should be reported back to the server in
|
|
141
|
+
// `RoutingHint.skipped_tablet_uid`; this cues the server to send updated
|
|
142
|
+
// information for this tablet should it become usable again.
|
|
143
|
+
bool skip = 7;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// A `Group` represents a paxos group in a database. A group is a set of
|
|
147
|
+
// tablets that are replicated across multiple servers. Groups may have a leader
|
|
148
|
+
// tablet. Groups store one (or sometimes more) ranges of keys.
|
|
149
|
+
message Group {
|
|
150
|
+
// The UID of the paxos group, unique within the database. Matches the
|
|
151
|
+
// `group_uid` field in `Range`.
|
|
152
|
+
uint64 group_uid = 1;
|
|
153
|
+
|
|
154
|
+
// A list of tablets that are part of the group. Note that this list may not
|
|
155
|
+
// be exhaustive; it will only include tablets the server considers useful
|
|
156
|
+
// to the client. The returned list is ordered ascending by distance.
|
|
157
|
+
//
|
|
158
|
+
// Tablet UIDs reference `Tablet.tablet_uid`.
|
|
159
|
+
repeated Tablet tablets = 2;
|
|
160
|
+
|
|
161
|
+
// The last known leader tablet of the group as an index into `tablets`. May
|
|
162
|
+
// be negative if the group has no known leader.
|
|
163
|
+
int32 leader_index = 3;
|
|
164
|
+
|
|
165
|
+
// `generation` indicates the freshness of the group information (including
|
|
166
|
+
// leader information) contained in this proto. Generations can be compared
|
|
167
|
+
// lexicographically; if generation A is greater than generation B, then the
|
|
168
|
+
// `Group` corresponding to A is newer than the `Group` corresponding to B,
|
|
169
|
+
// and should be used preferentially.
|
|
170
|
+
bytes generation = 4;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// A `KeyRecipe` provides the metadata required to translate reads, mutations,
|
|
174
|
+
// and queries into a byte array in "sortable string format" (ssformat)that can
|
|
175
|
+
// be used with `Range`s to route requests. Note that the client *must* tolerate
|
|
176
|
+
// `KeyRecipe`s that appear to be invalid, since the `KeyRecipe` format may
|
|
177
|
+
// change over time. Requests with invalid `KeyRecipe`s should be routed to a
|
|
178
|
+
// default server.
|
|
179
|
+
message KeyRecipe {
|
|
180
|
+
// An ssformat key is composed of a sequence of tag numbers and key column
|
|
181
|
+
// values. `Part` represents a single tag or key column value.
|
|
182
|
+
message Part {
|
|
183
|
+
// The remaining fields encode column values.
|
|
184
|
+
enum Order {
|
|
185
|
+
// Default value, equivalent to `ASCENDING`.
|
|
186
|
+
ORDER_UNSPECIFIED = 0;
|
|
187
|
+
|
|
188
|
+
// The key is ascending - corresponds to `ASC` in the schema definition.
|
|
189
|
+
ASCENDING = 1;
|
|
190
|
+
|
|
191
|
+
// The key is descending - corresponds to `DESC` in the schema definition.
|
|
192
|
+
DESCENDING = 2;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// The null order of the key column. This dictates where NULL values sort
|
|
196
|
+
// in the sorted order. Note that columns which are `NOT NULL` can have a
|
|
197
|
+
// special encoding.
|
|
198
|
+
enum NullOrder {
|
|
199
|
+
// Default value. This value is unused.
|
|
200
|
+
NULL_ORDER_UNSPECIFIED = 0;
|
|
201
|
+
|
|
202
|
+
// NULL values sort before any non-NULL values.
|
|
203
|
+
NULLS_FIRST = 1;
|
|
204
|
+
|
|
205
|
+
// NULL values sort after any non-NULL values.
|
|
206
|
+
NULLS_LAST = 2;
|
|
207
|
+
|
|
208
|
+
// The column does not support NULL values.
|
|
209
|
+
NOT_NULL = 3;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// If non-zero, `tag` is the only field present in this `Part`. The part
|
|
213
|
+
// is encoded by appending `tag` to the ssformat key.
|
|
214
|
+
uint32 tag = 1;
|
|
215
|
+
|
|
216
|
+
// Whether the key column is sorted ascending or descending. Only present
|
|
217
|
+
// if `tag` is zero.
|
|
218
|
+
Order order = 2;
|
|
219
|
+
|
|
220
|
+
// How NULLs are represented in the encoded key part. Only present if `tag`
|
|
221
|
+
// is zero.
|
|
222
|
+
NullOrder null_order = 3;
|
|
223
|
+
|
|
224
|
+
// The type of the key part. Only present if `tag` is zero.
|
|
225
|
+
Type type = 4;
|
|
226
|
+
|
|
227
|
+
// Only present if `tag` is zero.
|
|
228
|
+
oneof value_type {
|
|
229
|
+
// `identifier` is the name of the column or query parameter.
|
|
230
|
+
string identifier = 5;
|
|
231
|
+
|
|
232
|
+
// The constant value of the key part.
|
|
233
|
+
// It is present when query uses a constant as a part of the key.
|
|
234
|
+
google.protobuf.Value value = 6;
|
|
235
|
+
|
|
236
|
+
// If true, the client is responsible to fill in the value randomly.
|
|
237
|
+
// It's relevant only for the INT64 type.
|
|
238
|
+
bool random = 8;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// It is a repeated field to support fetching key columns from nested
|
|
242
|
+
// structs, such as `STRUCT` query parameters.
|
|
243
|
+
repeated int32 struct_identifiers = 7;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// A recipe can be associated with a table, index, or query. Tables recipes
|
|
247
|
+
// are used to encode read and write keys; index recipes are used for index
|
|
248
|
+
// reads, and query recipes are used only for SQL queries.
|
|
249
|
+
oneof target {
|
|
250
|
+
// A table name, matching the name from the database schema.
|
|
251
|
+
string table_name = 1;
|
|
252
|
+
|
|
253
|
+
// An index name, matching the name from the database schema.
|
|
254
|
+
string index_name = 2;
|
|
255
|
+
|
|
256
|
+
// The UID of a query, matching the UID from `RoutingHint`.
|
|
257
|
+
uint64 operation_uid = 3;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// Parts are in the order they should appear in the encoded key.
|
|
261
|
+
repeated Part part = 4;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// A `RecipeList` contains a list of `KeyRecipe`s, which share the same
|
|
265
|
+
// schema generation.
|
|
266
|
+
message RecipeList {
|
|
267
|
+
// The schema generation of the recipes. To be sent to the server in
|
|
268
|
+
// `RoutingHint.schema_generation` whenever one of the recipes is used.
|
|
269
|
+
// `schema_generation` values are comparable with each other; if generation A
|
|
270
|
+
// compares greater than generation B, then A is a more recent schema than B.
|
|
271
|
+
// Clients should in general aim to cache only the latest schema generation,
|
|
272
|
+
// and discard more stale recipes.
|
|
273
|
+
bytes schema_generation = 1;
|
|
274
|
+
|
|
275
|
+
// A list of recipes to be cached.
|
|
276
|
+
repeated KeyRecipe recipe = 3;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// A `CacheUpdate` expresses a set of changes the client should incorporate into
|
|
280
|
+
// its location cache. These changes may or may not be newer than what the
|
|
281
|
+
// client has in its cache, and should be discarded if necessary. `CacheUpdate`s
|
|
282
|
+
// can be obtained in response to requests that included a `RoutingHint`
|
|
283
|
+
// field, but may also be obtained by explicit location-fetching RPCs which may
|
|
284
|
+
// be added in the future.
|
|
285
|
+
message CacheUpdate {
|
|
286
|
+
// An internal ID for the database. Database names can be reused if a database
|
|
287
|
+
// is deleted and re-created. Each time the database is re-created, it will
|
|
288
|
+
// get a new database ID, which will never be re-used for any other database.
|
|
289
|
+
uint64 database_id = 1;
|
|
290
|
+
|
|
291
|
+
// A list of ranges to be cached.
|
|
292
|
+
repeated Range range = 2;
|
|
293
|
+
|
|
294
|
+
// A list of groups to be cached.
|
|
295
|
+
repeated Group group = 3;
|
|
296
|
+
|
|
297
|
+
// A list of recipes to be cached.
|
|
298
|
+
RecipeList key_recipes = 5;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// `RoutingHint` can be optionally added to location-aware Spanner
|
|
302
|
+
// requests. It gives the server hints that can be used to route the request to
|
|
303
|
+
// an appropriate server, potentially significantly decreasing latency and
|
|
304
|
+
// improving throughput. To achieve improved performance, most fields must be
|
|
305
|
+
// filled in with accurate values.
|
|
306
|
+
//
|
|
307
|
+
// The presence of a valid `RoutingHint` tells the server that the client
|
|
308
|
+
// is location-aware.
|
|
309
|
+
//
|
|
310
|
+
// `RoutingHint` does not change the semantics of the request; it is
|
|
311
|
+
// purely a performance hint; the request will perform the same actions on the
|
|
312
|
+
// database's data as if `RoutingHint` were not present. However, if
|
|
313
|
+
// the `RoutingHint` is incomplete or incorrect, the response may include
|
|
314
|
+
// a `CacheUpdate` the client can use to correct its location cache.
|
|
315
|
+
message RoutingHint {
|
|
316
|
+
// A tablet that was skipped by the client. See `Tablet.tablet_uid` and
|
|
317
|
+
// `Tablet.incarnation`.
|
|
318
|
+
message SkippedTablet {
|
|
319
|
+
// The tablet UID of the tablet that was skipped. See `Tablet.tablet_uid`.
|
|
320
|
+
uint64 tablet_uid = 1;
|
|
321
|
+
|
|
322
|
+
// The incarnation of the tablet that was skipped. See `Tablet.incarnation`.
|
|
323
|
+
bytes incarnation = 2;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// A session-scoped unique ID for the operation, computed client-side.
|
|
327
|
+
// Requests with the same `operation_uid` should have a shared 'shape',
|
|
328
|
+
// meaning that some fields are expected to be the same, such as the SQL
|
|
329
|
+
// query, the target table/columns (for reads) etc. Requests with the same
|
|
330
|
+
// `operation_uid` are meant to differ only in fields like keys/key
|
|
331
|
+
// ranges/query parameters, transaction IDs, etc.
|
|
332
|
+
//
|
|
333
|
+
// `operation_uid` must be non-zero for `RoutingHint` to be valid.
|
|
334
|
+
uint64 operation_uid = 1;
|
|
335
|
+
|
|
336
|
+
// The database ID of the database being accessed, see
|
|
337
|
+
// `CacheUpdate.database_id`. Should match the cache entries that were used
|
|
338
|
+
// to generate the rest of the fields in this `RoutingHint`.
|
|
339
|
+
uint64 database_id = 2;
|
|
340
|
+
|
|
341
|
+
// The schema generation of the recipe that was used to generate `key` and
|
|
342
|
+
// `limit_key`. See also `RecipeList.schema_generation`.
|
|
343
|
+
bytes schema_generation = 3;
|
|
344
|
+
|
|
345
|
+
// The key / key range that this request accesses. For operations that
|
|
346
|
+
// access a single key, `key` should be set and `limit_key` should be empty.
|
|
347
|
+
// For operations that access a key range, `key` and `limit_key` should both
|
|
348
|
+
// be set, to the inclusive start and exclusive end of the range respectively.
|
|
349
|
+
//
|
|
350
|
+
// The keys are encoded in "sortable string format" (ssformat), using a
|
|
351
|
+
// `KeyRecipe` that is appropriate for the request. See `KeyRecipe` for more
|
|
352
|
+
// details.
|
|
353
|
+
bytes key = 4;
|
|
354
|
+
|
|
355
|
+
// If this request targets a key range, this is the exclusive end of the
|
|
356
|
+
// range. See `key` for more details.
|
|
357
|
+
bytes limit_key = 5;
|
|
358
|
+
|
|
359
|
+
// The group UID of the group that the client believes serves the range
|
|
360
|
+
// defined by `key` and `limit_key`. See `Range.group_uid` for more details.
|
|
361
|
+
uint64 group_uid = 6;
|
|
362
|
+
|
|
363
|
+
// The split ID of the split that the client believes contains the range
|
|
364
|
+
// defined by `key` and `limit_key`. See `Range.split_id` for more details.
|
|
365
|
+
uint64 split_id = 7;
|
|
366
|
+
|
|
367
|
+
// The tablet UID of the tablet from group `group_uid` that the client
|
|
368
|
+
// believes is best to serve this request. See `Group.local_tablet_uids` and
|
|
369
|
+
// `Group.leader_tablet_uid`.
|
|
370
|
+
uint64 tablet_uid = 8;
|
|
371
|
+
|
|
372
|
+
// If the client had multiple options for tablet selection, and some of its
|
|
373
|
+
// first choices were unhealthy (e.g., the server is unreachable, or
|
|
374
|
+
// `Tablet.skip` is true), this field will contain the tablet UIDs of those
|
|
375
|
+
// tablets, with their incarnations. The server may include a `CacheUpdate`
|
|
376
|
+
// with new locations for those tablets.
|
|
377
|
+
repeated SkippedTablet skipped_tablet_uid = 9;
|
|
378
|
+
|
|
379
|
+
// If present, the client's current location. This should be the name of a
|
|
380
|
+
// Google Cloud zone or region, such as "us-central1".
|
|
381
|
+
//
|
|
382
|
+
// If absent, the client's location will be assumed to be the same as the
|
|
383
|
+
// location of the server the client ends up connected to.
|
|
384
|
+
//
|
|
385
|
+
// Locations are primarily valuable for clients that connect from regions
|
|
386
|
+
// other than the ones that contain the Spanner database.
|
|
387
|
+
string client_location = 10;
|
|
388
|
+
}
|
|
@@ -18,6 +18,7 @@ package google.spanner.v1;
|
|
|
18
18
|
|
|
19
19
|
import "google/api/field_behavior.proto";
|
|
20
20
|
import "google/protobuf/struct.proto";
|
|
21
|
+
import "google/protobuf/timestamp.proto";
|
|
21
22
|
import "google/spanner/v1/keys.proto";
|
|
22
23
|
|
|
23
24
|
option csharp_namespace = "Google.Cloud.Spanner.V1";
|
|
@@ -75,6 +76,40 @@ message Mutation {
|
|
|
75
76
|
KeySet key_set = 2 [(google.api.field_behavior) = REQUIRED];
|
|
76
77
|
}
|
|
77
78
|
|
|
79
|
+
// Arguments to [send][google.spanner.v1.Mutation.send] operations.
|
|
80
|
+
message Send {
|
|
81
|
+
// Required. The queue to which the message will be sent.
|
|
82
|
+
string queue = 1 [(google.api.field_behavior) = REQUIRED];
|
|
83
|
+
|
|
84
|
+
// Required. The primary key of the message to be sent.
|
|
85
|
+
google.protobuf.ListValue key = 2 [(google.api.field_behavior) = REQUIRED];
|
|
86
|
+
|
|
87
|
+
// The time at which Spanner will begin attempting to deliver the message.
|
|
88
|
+
// If `deliver_time` is not set, Spanner will deliver the message
|
|
89
|
+
// immediately. If `deliver_time` is in the past, Spanner will replace it
|
|
90
|
+
// with a value closer to the current time.
|
|
91
|
+
google.protobuf.Timestamp deliver_time = 3;
|
|
92
|
+
|
|
93
|
+
// The payload of the message.
|
|
94
|
+
google.protobuf.Value payload = 4;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Arguments to [ack][google.spanner.v1.Mutation.ack] operations.
|
|
98
|
+
message Ack {
|
|
99
|
+
// Required. The queue where the message to be acked is stored.
|
|
100
|
+
string queue = 1 [(google.api.field_behavior) = REQUIRED];
|
|
101
|
+
|
|
102
|
+
// Required. The primary key of the message to be acked.
|
|
103
|
+
google.protobuf.ListValue key = 2 [(google.api.field_behavior) = REQUIRED];
|
|
104
|
+
|
|
105
|
+
// By default, an attempt to ack a message that does not exist will fail
|
|
106
|
+
// with a `NOT_FOUND` error. With `ignore_not_found` set to true, the ack
|
|
107
|
+
// will succeed even if the message does not exist. This is useful for
|
|
108
|
+
// unconditionally acking a message, even if it is missing or has already
|
|
109
|
+
// been acked.
|
|
110
|
+
bool ignore_not_found = 3;
|
|
111
|
+
}
|
|
112
|
+
|
|
78
113
|
// Required. The operation to perform.
|
|
79
114
|
oneof operation {
|
|
80
115
|
// Insert new rows in a table. If any of the rows already exist,
|
|
@@ -111,5 +146,11 @@ message Mutation {
|
|
|
111
146
|
// Delete rows from a table. Succeeds whether or not the named
|
|
112
147
|
// rows were present.
|
|
113
148
|
Delete delete = 5;
|
|
149
|
+
|
|
150
|
+
// Send a message to a queue.
|
|
151
|
+
Send send = 6;
|
|
152
|
+
|
|
153
|
+
// Ack a message from a queue.
|
|
154
|
+
Ack ack = 7;
|
|
114
155
|
}
|
|
115
156
|
}
|
|
@@ -16,6 +16,7 @@ syntax = "proto3";
|
|
|
16
16
|
|
|
17
17
|
package google.spanner.v1;
|
|
18
18
|
|
|
19
|
+
import "google/api/field_behavior.proto";
|
|
19
20
|
import "google/protobuf/struct.proto";
|
|
20
21
|
|
|
21
22
|
option csharp_namespace = "Google.Cloud.Spanner.V1";
|
|
@@ -122,10 +123,34 @@ message PlanNode {
|
|
|
122
123
|
google.protobuf.Struct execution_stats = 7;
|
|
123
124
|
}
|
|
124
125
|
|
|
126
|
+
// Output of query advisor analysis.
|
|
127
|
+
message QueryAdvisorResult {
|
|
128
|
+
// Recommendation to add new indexes to run queries more efficiently.
|
|
129
|
+
message IndexAdvice {
|
|
130
|
+
// Optional. DDL statements to add new indexes that will improve the query.
|
|
131
|
+
repeated string ddl = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
132
|
+
|
|
133
|
+
// Optional. Estimated latency improvement factor. For example if the query
|
|
134
|
+
// currently takes 500 ms to run and the estimated latency with new indexes
|
|
135
|
+
// is 100 ms this field will be 5.
|
|
136
|
+
double improvement_factor = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Optional. Index Recommendation for a query. This is an optional field and
|
|
140
|
+
// the recommendation will only be available when the recommendation
|
|
141
|
+
// guarantees significant improvement in query performance.
|
|
142
|
+
repeated IndexAdvice index_advice = 1
|
|
143
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
144
|
+
}
|
|
145
|
+
|
|
125
146
|
// Contains an ordered list of nodes appearing in the query plan.
|
|
126
147
|
message QueryPlan {
|
|
127
148
|
// The nodes in the query plan. Plan nodes are returned in pre-order starting
|
|
128
149
|
// with the plan root. Each [PlanNode][google.spanner.v1.PlanNode]'s `id`
|
|
129
150
|
// corresponds to its index in `plan_nodes`.
|
|
130
151
|
repeated PlanNode plan_nodes = 1;
|
|
152
|
+
|
|
153
|
+
// Optional. The advise/recommendations for a query. Currently this field will
|
|
154
|
+
// be serving index recommendations for a query.
|
|
155
|
+
QueryAdvisorResult query_advice = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
131
156
|
}
|
|
@@ -18,6 +18,7 @@ package google.spanner.v1;
|
|
|
18
18
|
|
|
19
19
|
import "google/api/field_behavior.proto";
|
|
20
20
|
import "google/protobuf/struct.proto";
|
|
21
|
+
import "google/spanner/v1/location.proto";
|
|
21
22
|
import "google/spanner/v1/query_plan.proto";
|
|
22
23
|
import "google/spanner/v1/transaction.proto";
|
|
23
24
|
import "google/spanner/v1/type.proto";
|
|
@@ -181,6 +182,14 @@ message PartialResultSet {
|
|
|
181
182
|
// stream. The server might optionally set this field. Clients shouldn't rely
|
|
182
183
|
// on this field being set in all cases.
|
|
183
184
|
bool last = 9 [(google.api.field_behavior) = OPTIONAL];
|
|
185
|
+
|
|
186
|
+
// Optional. A cache update expresses a set of changes the client should
|
|
187
|
+
// incorporate into its location cache. The client should discard the changes
|
|
188
|
+
// if they are older than the data it already has. This data can be obtained
|
|
189
|
+
// in response to requests that included a `RoutingHint` field, but may also
|
|
190
|
+
// be obtained by explicit location-fetching RPCs which may be added in the
|
|
191
|
+
// future.
|
|
192
|
+
CacheUpdate cache_update = 10 [(google.api.field_behavior) = OPTIONAL];
|
|
184
193
|
}
|
|
185
194
|
|
|
186
195
|
// Metadata about a [ResultSet][google.spanner.v1.ResultSet] or
|