HRW.Weighted
(hrw v0.2.0)
Copy Markdown
Weighted HRW implementation for ensuring certain nodes get a greater share of keys.
Inspired by https://www.ietf.org/archive/id/draft-ietf-bess-weighted-hrw-00.html
Works with both flat lists (HRW.owner(key, [{"a", 1}, {"b", 4}], scorer: %HRW.Weighted{}))
and skeletons (HRW.build([...], scorer: %HRW.Weighted{})).
Summary
Types
@type t() :: %HRW.Weighted{ branch_weights: tuple() | nil, fanout: pos_integer() | nil, hash_fn: (term() -> integer()) | nil }