This repository was archived by the owner on Apr 7, 2026. It is now read-only.
Commit 5a9eb87
committed
feat: add KeyRangeCache for SpanFE bypass routing
This commit adds the KeyRangeCache that maintains a mapping from key
ranges to Spanner groups, splits, and tablets:
- Caches Range information (start/limit keys mapped to groups/splits)
- Caches Group information (tablets within groups, leader tablet info)
- Caches Tablet information (server addresses for each tablet)
- Manages server connections via ChannelFinderServerFactory
Key features:
- Efficient key range lookup using NavigableMap with ByteString keys
- Generation-based cache invalidation to handle schema changes
- Support for leader and local replica tablet selection
- Thread-safe operations with proper synchronization
The cache is populated from CacheUpdate responses received from the
server and provides routing hints for subsequent requests.
Depends on: ChannelFinder interfaces (PR #2)
This is part of the SpanFE bypass feature that enables location-aware
routing for improved latency.1 parent c4c9c69 commit 5a9eb87
1 file changed
Lines changed: 572 additions & 0 deletions
0 commit comments