You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrate partition key ranges to KeyRange and extract sharding types
Part of the effort to break the restate-types monolith into composable,
focused utility crates.
Replace all ~85 uses of std::ops::RangeInclusive<PartitionKey> with the new
KeyRange type from restate-util-sharding. Move PartitionId and
EqualSizedPartitionPartitioner into restate-util-sharding alongside KeyRange,
re-exporting from restate-types for backwards compatibility.
The migration is mechanical: .start()/.end() now return u64 by value instead
of &u64, .clone() calls are removed (KeyRange is Copy), and construction
switches from a..=b syntax to KeyRange::new(a, b).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: AGENTS.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,7 @@ If these rules conflict with normal behavior, always follow the rules above.
52
52
1. Check crates/cli-util/README.md when doing CLI changes to make sure that you are adhering to the CLI style guide.
53
53
1. New or deprecated config options must have `/// Since vX.Y.Z` in their doc comment.
54
54
1. Use `ByteCount::from(value)` (from `restate_memory`) when displaying byte sizes in errors/logs.
55
+
1. Use `KeyRange` (from `restate_sharding`, re-exported via `restate_types::sharding::KeyRange`) instead of `std::ops::RangeInclusive<PartitionKey>` for partition key ranges. `KeyRange` is `Copy`, 16 bytes (vs 24), and has wire-compatible serde/bilrost encoding.
0 commit comments