Compute the vShard ID for an array tile by tile identifier. Use this when the tile_id is already known (e.g. from the op-log key or snapshot metadata) and coord re-derivation is unnecessary. Returns a raw `u16` in `0..1023`. Callers wrap it in `VShardId::new(…)`.
(array_name: &str, tile_id: u64)
| 135 | /// |
| 136 | /// Returns a raw `u16` in `0..1023`. Callers wrap it in `VShardId::new(…)`. |
| 137 | pub fn vshard_for_array_tile(array_name: &str, tile_id: u64) -> u32 { |
| 138 | let mut buf = Vec::with_capacity(array_name.len() + 8); |
| 139 | buf.extend_from_slice(array_name.as_bytes()); |
| 140 | buf.extend_from_slice(&tile_id.to_le_bytes()); |
| 141 | vshard_from_key(&buf) |
| 142 | } |
| 143 | |
| 144 | // ─── Tests ──────────────────────────────────────────────────────────────────── |
| 145 |