API Reference hrw v#0.2.1
Copy MarkdownModules
HRW (Highest Random Weight), also known as rendezvous hashing, maps a key to a node out of a set in a way that stays stable when nodes are added or removed.
A bounded-load variant of HRW. Distributes a known set of keys across nodes
such that no node receives more than ceil(|keys| / |nodes| × (1 + epsilon))
keys.
Behaviour for HRW scoring strategies. Each variant module (HRW, future
HRW.Weighted, etc.) defines a struct holding its configuration and
implements score/3 returning a score for a (key, node) pair.
Internal data structure backing HRW.build/2 and HRW.owner/3 for
O(log n) lookups. Nodes are grouped into clusters and routed through a
virtual tree. Plain data, not a process.
Weighted HRW implementation for ensuring certain nodes get a greater share of keys.