Commit ef2c8a1
committed
feat: add KeyRecipe and KeyRecipeCache
This commit adds the key recipe system that enables encoding of Spanner
keys from request parameters:
- KeyRecipe: Translates read/query requests into ssformat keys using
recipes provided by the server. Supports all Spanner types including:
- Primitive types (INT64, FLOAT64, STRING, BYTES, BOOL)
- Date, Timestamp, and Numeric types
- Complex types with nested field extraction
- Ascending/descending key ordering
- NULL handling with configurable ordering
- KeyRecipeCache: Caches KeyRecipes by table/index/query and schema
generation. Provides efficient lookup and key computation for
recurring request patterns.
- Golden tests: Comprehensive test suite using golden test data to
verify key encoding correctness.
Depends on: SsFormat encoding library (PR #1)
This is part of the experimental location-aware routing for improved
latency.1 parent 77c4f60 commit ef2c8a1
File tree
7 files changed
+5654
-2
lines changed- google-cloud-spanner/src
- main/java/com/google/cloud/spanner/spi/v1
- test
- java/com/google/cloud/spanner/spi/v1
- resources
7 files changed
+5654
-2
lines changed
0 commit comments