Skip to main content

array_vshards_for_slice

Function array_vshards_for_slice 

Source
pub fn array_vshards_for_slice(
    slice_hilbert_ranges: &[(u64, u64)],
    prefix_bits: u8,
    total_shards: u32,
) -> Result<Vec<u32>>
Expand description

Determine all vShards that intersect a set of Hilbert-prefix ranges.

slice_hilbert_ranges — list of (lo, hi) inclusive Hilbert-prefix ranges covering the slice’s MBR. An empty slice means “unbounded” (returns all vShards up to total_shards).

prefix_bits — routing granularity (1–16). total_shards — number of active vShards; returned IDs are clamped to [0, total_shards).

Returns a sorted, deduplicated list of vShard IDs.