Commit ecb5116
Introduce restate-sharding crate
Part of the effort to decompose the restate-types monolith into focused,
composable utility crates.
Add a new `restate-sharding` crate (in `crates/sharding/`) that defines
the foundational sharding types:
- `KeyRange`: a compact `Copy` newtype over `std::range::RangeInclusive<u64>`.
16 bytes (vs 24 for std::ops::RangeInclusive), wire-format compatible serde
and bilrost encoding. Provides iter(), is_overlapping(), and split() helpers.
- `PartitionKey`: type alias for u64
- `WithPartitionKey`: trait for types that carry a partition key
The crate is re-exported from `restate-types::sharding` for ergonomic access.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 4e30658 commit ecb5116
11 files changed
Lines changed: 568 additions & 20 deletions
File tree
- crates
- encoding
- sharding
- src
- types
- src
- invocation
- wal-protocol/src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
0 commit comments