Skip to main content

Crate ketama_hash_ring

Crate ketama_hash_ring 

Source
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§

ConsistentHashRing
Weighted Ketama virtual-node consistent hash ring with O(log V) binary search.
MaglevHash
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 (65537 offers < 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 Hash key into a 64-bit digest suitable for consistent hashing.
jump_consistent_hash
Computes the Lamping-Veach Jump Consistent Hash mapping key to [0, buckets).