Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit da420d1

Browse files
1 parent bd0e6a1 commit da420d1

File tree

304 files changed

+96
-135062
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

304 files changed

+96
-135062
lines changed

google/cloud/spanner_v1/services/spanner/async_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949

5050
from google.cloud.spanner_v1.services.spanner import pagers
5151
from google.cloud.spanner_v1.types import commit_response
52+
from google.cloud.spanner_v1.types import location
5253
from google.cloud.spanner_v1.types import mutation
5354
from google.cloud.spanner_v1.types import result_set
5455
from google.cloud.spanner_v1.types import spanner

google/cloud/spanner_v1/services/spanner/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464

6565
from google.cloud.spanner_v1.services.spanner import pagers
6666
from google.cloud.spanner_v1.types import commit_response
67+
from google.cloud.spanner_v1.types import location
6768
from google.cloud.spanner_v1.types import mutation
6869
from google.cloud.spanner_v1.types import result_set
6970
from google.cloud.spanner_v1.types import spanner

google/cloud/spanner_v1/types/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@
2323
KeyRange,
2424
KeySet,
2525
)
26+
from .location import (
27+
CacheUpdate,
28+
Group,
29+
KeyRecipe,
30+
Range,
31+
RecipeList,
32+
RoutingHint,
33+
Tablet,
34+
)
2635
from .mutation import (
2736
Mutation,
2837
)
@@ -81,6 +90,13 @@
8190
"CommitResponse",
8291
"KeyRange",
8392
"KeySet",
93+
"CacheUpdate",
94+
"Group",
95+
"KeyRecipe",
96+
"Range",
97+
"RecipeList",
98+
"RoutingHint",
99+
"Tablet",
84100
"Mutation",
85101
"PlanNode",
86102
"QueryAdvisorResult",

owl-bot-staging/spanner/v1/google/cloud/spanner_v1/types/location.py renamed to google/cloud/spanner_v1/types/location.py

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424

2525

2626
__protobuf__ = proto.module(
27-
package='google.spanner.v1',
27+
package="google.spanner.v1",
2828
manifest={
29-
'Range',
30-
'Tablet',
31-
'Group',
32-
'KeyRecipe',
33-
'RecipeList',
34-
'CacheUpdate',
35-
'RoutingHint',
29+
"Range",
30+
"Tablet",
31+
"Group",
32+
"KeyRecipe",
33+
"RecipeList",
34+
"CacheUpdate",
35+
"RoutingHint",
3636
},
3737
)
3838

@@ -172,6 +172,7 @@ class Tablet(proto.Message):
172172
this cues the server to send updated information for this
173173
tablet should it become usable again.
174174
"""
175+
175176
class Role(proto.Enum):
176177
r"""Indicates the role of the tablet.
177178
@@ -253,10 +254,10 @@ class Group(proto.Message):
253254
proto.UINT64,
254255
number=1,
255256
)
256-
tablets: MutableSequence['Tablet'] = proto.RepeatedField(
257+
tablets: MutableSequence["Tablet"] = proto.RepeatedField(
257258
proto.MESSAGE,
258259
number=2,
259-
message='Tablet',
260+
message="Tablet",
260261
)
261262
leader_index: int = proto.Field(
262263
proto.INT32,
@@ -348,6 +349,7 @@ class Part(proto.Message):
348349
It is a repeated field to support fetching key columns from
349350
nested structs, such as ``STRUCT`` query parameters.
350351
"""
352+
351353
class Order(proto.Enum):
352354
r"""The remaining fields encode column values.
353355
@@ -389,15 +391,15 @@ class NullOrder(proto.Enum):
389391
proto.UINT32,
390392
number=1,
391393
)
392-
order: 'KeyRecipe.Part.Order' = proto.Field(
394+
order: "KeyRecipe.Part.Order" = proto.Field(
393395
proto.ENUM,
394396
number=2,
395-
enum='KeyRecipe.Part.Order',
397+
enum="KeyRecipe.Part.Order",
396398
)
397-
null_order: 'KeyRecipe.Part.NullOrder' = proto.Field(
399+
null_order: "KeyRecipe.Part.NullOrder" = proto.Field(
398400
proto.ENUM,
399401
number=3,
400-
enum='KeyRecipe.Part.NullOrder',
402+
enum="KeyRecipe.Part.NullOrder",
401403
)
402404
type_: gs_type.Type = proto.Field(
403405
proto.MESSAGE,
@@ -407,18 +409,18 @@ class NullOrder(proto.Enum):
407409
identifier: str = proto.Field(
408410
proto.STRING,
409411
number=5,
410-
oneof='value_type',
412+
oneof="value_type",
411413
)
412414
value: struct_pb2.Value = proto.Field(
413415
proto.MESSAGE,
414416
number=6,
415-
oneof='value_type',
417+
oneof="value_type",
416418
message=struct_pb2.Value,
417419
)
418420
random: bool = proto.Field(
419421
proto.BOOL,
420422
number=8,
421-
oneof='value_type',
423+
oneof="value_type",
422424
)
423425
struct_identifiers: MutableSequence[int] = proto.RepeatedField(
424426
proto.INT32,
@@ -428,17 +430,17 @@ class NullOrder(proto.Enum):
428430
table_name: str = proto.Field(
429431
proto.STRING,
430432
number=1,
431-
oneof='target',
433+
oneof="target",
432434
)
433435
index_name: str = proto.Field(
434436
proto.STRING,
435437
number=2,
436-
oneof='target',
438+
oneof="target",
437439
)
438440
operation_uid: int = proto.Field(
439441
proto.UINT64,
440442
number=3,
441-
oneof='target',
443+
oneof="target",
442444
)
443445
part: MutableSequence[Part] = proto.RepeatedField(
444446
proto.MESSAGE,
@@ -468,10 +470,10 @@ class RecipeList(proto.Message):
468470
proto.BYTES,
469471
number=1,
470472
)
471-
recipe: MutableSequence['KeyRecipe'] = proto.RepeatedField(
473+
recipe: MutableSequence["KeyRecipe"] = proto.RepeatedField(
472474
proto.MESSAGE,
473475
number=3,
474-
message='KeyRecipe',
476+
message="KeyRecipe",
475477
)
476478

477479

@@ -503,20 +505,20 @@ class CacheUpdate(proto.Message):
503505
proto.UINT64,
504506
number=1,
505507
)
506-
range_: MutableSequence['Range'] = proto.RepeatedField(
508+
range_: MutableSequence["Range"] = proto.RepeatedField(
507509
proto.MESSAGE,
508510
number=2,
509-
message='Range',
511+
message="Range",
510512
)
511-
group: MutableSequence['Group'] = proto.RepeatedField(
513+
group: MutableSequence["Group"] = proto.RepeatedField(
512514
proto.MESSAGE,
513515
number=3,
514-
message='Group',
516+
message="Group",
515517
)
516-
key_recipes: 'RecipeList' = proto.Field(
518+
key_recipes: "RecipeList" = proto.Field(
517519
proto.MESSAGE,
518520
number=5,
519-
message='RecipeList',
521+
message="RecipeList",
520522
)
521523

522524

google/cloud/spanner_v1/types/result_set.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import proto # type: ignore
2121

22+
from google.cloud.spanner_v1.types import location
2223
from google.cloud.spanner_v1.types import query_plan as gs_query_plan
2324
from google.cloud.spanner_v1.types import transaction as gs_transaction
2425
from google.cloud.spanner_v1.types import type as gs_type
@@ -223,6 +224,14 @@ class PartialResultSet(proto.Message):
223224
``PartialResultSet`` in the stream. The server might
224225
optionally set this field. Clients shouldn't rely on this
225226
field being set in all cases.
227+
cache_update (google.cloud.spanner_v1.types.CacheUpdate):
228+
Optional. A cache update expresses a set of changes the
229+
client should incorporate into its location cache. The
230+
client should discard the changes if they are older than the
231+
data it already has. This data can be obtained in response
232+
to requests that included a ``RoutingHint`` field, but may
233+
also be obtained by explicit location-fetching RPCs which
234+
may be added in the future.
226235
"""
227236

228237
metadata: "ResultSetMetadata" = proto.Field(
@@ -257,6 +266,11 @@ class PartialResultSet(proto.Message):
257266
proto.BOOL,
258267
number=9,
259268
)
269+
cache_update: location.CacheUpdate = proto.Field(
270+
proto.MESSAGE,
271+
number=10,
272+
message=location.CacheUpdate,
273+
)
260274

261275

262276
class ResultSetMetadata(proto.Message):

google/cloud/spanner_v1/types/spanner.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import proto # type: ignore
2121

2222
from google.cloud.spanner_v1.types import keys
23+
from google.cloud.spanner_v1.types import location as gs_location
2324
from google.cloud.spanner_v1.types import mutation
2425
from google.cloud.spanner_v1.types import result_set
2526
from google.cloud.spanner_v1.types import transaction as gs_transaction
@@ -660,6 +661,15 @@ class ExecuteSqlRequest(proto.Message):
660661
example, validation of unique constraints). Given this,
661662
successful execution of a DML statement shouldn't be assumed
662663
until a subsequent ``Commit`` call completes successfully.
664+
routing_hint (google.cloud.spanner_v1.types.RoutingHint):
665+
Optional. If present, it makes the Spanner
666+
requests location-aware.
667+
It gives the server hints that can be used to
668+
route the request to an appropriate server,
669+
potentially significantly decreasing latency and
670+
improving throughput. To achieve improved
671+
performance, most fields must be filled in with
672+
accurate values.
663673
"""
664674

665675
class QueryMode(proto.Enum):
@@ -826,6 +836,11 @@ class QueryOptions(proto.Message):
826836
proto.BOOL,
827837
number=17,
828838
)
839+
routing_hint: gs_location.RoutingHint = proto.Field(
840+
proto.MESSAGE,
841+
number=18,
842+
message=gs_location.RoutingHint,
843+
)
829844

830845

831846
class ExecuteBatchDmlRequest(proto.Message):
@@ -1385,6 +1400,15 @@ class ReadRequest(proto.Message):
13851400
lock_hint (google.cloud.spanner_v1.types.ReadRequest.LockHint):
13861401
Optional. Lock Hint for the request, it can
13871402
only be used with read-write transactions.
1403+
routing_hint (google.cloud.spanner_v1.types.RoutingHint):
1404+
Optional. If present, it makes the Spanner
1405+
requests location-aware.
1406+
It gives the server hints that can be used to
1407+
route the request to an appropriate server,
1408+
potentially significantly decreasing latency and
1409+
improving throughput. To achieve improved
1410+
performance, most fields must be filled in with
1411+
accurate values.
13881412
"""
13891413

13901414
class OrderBy(proto.Enum):
@@ -1530,6 +1554,11 @@ class LockHint(proto.Enum):
15301554
number=17,
15311555
enum=LockHint,
15321556
)
1557+
routing_hint: gs_location.RoutingHint = proto.Field(
1558+
proto.MESSAGE,
1559+
number=18,
1560+
message=gs_location.RoutingHint,
1561+
)
15331562

15341563

15351564
class BeginTransactionRequest(proto.Message):

owl-bot-staging/spanner/v1/.coveragerc

Lines changed: 0 additions & 13 deletions
This file was deleted.

owl-bot-staging/spanner/v1/.flake8

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)