Hash `key` using the algorithm recorded in the cluster's [`PlacementHashId`]. Callers load the `PlacementHashId` from `ClusterSettings` once at startup and pass it through every shard-split / shuffle operation. The underlying implementations live in [`crate::catalog::placement_hash`]; this function is the routing-layer entry point so callers do not need to import the catalog module directly.
(placement_hash_id: crate::catalog::PlacementHashId, key: &str)
| 294 | /// [`crate::catalog::placement_hash`]; this function is the routing-layer |
| 295 | /// entry point so callers do not need to import the catalog module directly. |
| 296 | pub fn partition_hash(placement_hash_id: crate::catalog::PlacementHashId, key: &str) -> u64 { |
| 297 | crate::catalog::placement_hash(placement_hash_id, key.as_bytes()) |
| 298 | } |
| 299 | |
| 300 | #[cfg(test)] |
| 301 | mod tests { |