Skip to main content

bucketize

Function bucketize 

Source
fn bucketize(ns_table: &[Range<usize>], threshold: usize) -> Vec<Vec<usize>>
Expand description

Group namespace indices into buckets whose payload sizes are each at least threshold bytes (except possibly the last), coalescing small namespaces so the disperser sends one message per bucket rather than one per namespace.

A threshold of 0 puts every namespace in its own bucket (no coalescing); a threshold larger than the whole payload yields a single bucket. A namespace at least threshold bytes on its own seals its bucket immediately, so large namespaces stay separate while small ones accumulate.