ketama-hash-ring 11.2.0

Zero-dependency consistent hashing suite implementing Jump Consistent Hash, weighted Ketama virtual-node rings, and Google Maglev O(1) lookup tables.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
/// Compact Maglev lookup table representation shrinking memory footprint up to 8x.
#[derive(Clone, Debug)]
pub(crate) enum MaglevTable {
    /// Empty lookup table when zero nodes are configured.
    Empty,
    /// Ultra-compact 8-bit backend indices for clusters up to `254` nodes (64 KB for default M).
    U8(Vec<u8>),
    /// Compact 16-bit backend indices for clusters up to `65534` nodes.
    U16(Vec<u16>),
    /// Full 32-bit backend indices for larger clusters.
    U32(Vec<u32>),
}