Expand description
ketama-hash-ring
Zero-dependency consistent hashing suite providing Jump Consistent Hash, weighted Ketama virtual-node rings, and Google Maglev O(1) lookup tables.
Structs§
- Consistent
Hash Ring - Weighted Ketama virtual-node consistent hash ring with SoA cache-friendly binary search.
- Maglev
Hash - Google Maglev O(1) consistent hashing lookup table with minimal disruption on node changes.
Constants§
- DEFAULT_
MAGLEV_ TABLE_ SIZE - Default prime Maglev lookup table size (
65537offers < 1% imbalance). - DEFAULT_
VIRTUAL_ NODES - Default number of virtual nodes per unit of node weight on a [
ConsistentHashRing].
Functions§
- hash_
bytes - Computes a fast 64-bit hash of a byte slice with zero seed.
- hash_
bytes_ seeded - Computes a fast 64-bit hash of a byte slice with a seed using FNV-1a + SplitMix64 finalization.
- hash_
key - Hashes any
Hashkey into a 64-bit digest suitable for consistent hashing. - jump_
consistent_ hash - Computes the Lamping-Veach Jump Consistent Hash mapping
keyto[0, buckets).