base/utils/hash_hrw.zeek¶
-
HashHRW¶
An implementation of highest random weight (HRW) hashing, also called rendezvous hashing. See https://en.wikipedia.org/wiki/Rendezvous_hashing.
- Namespace
HashHRW
Summary¶
Types¶
A collection of sites to distribute keys across. |
|
A site/node is a unique location to which you want a subset of keys to be distributed. |
|
A table of sites, indexed by their id. |
Functions¶
Add a site to a pool. |
|
Returns: the site to which the key maps. |
|
Remove a site from a pool. |
Detailed Interface¶
Types¶
-
HashHRW::Pool¶ - Type
-
sites:
HashHRW::SiteTable&default={ }&optional
A collection of sites to distribute keys across.
-
HashHRW::Site¶ - Type
A site/node is a unique location to which you want a subset of keys to be distributed.
-
HashHRW::SiteTable¶ - Type
table[count] ofHashHRW::Site
A table of sites, indexed by their id.
Functions¶
-
HashHRW::add_site¶ - Type
function(pool:HashHRW::Pool, site:HashHRW::Site) :bool
Add a site to a pool.
- Returns
F is the site is already in the pool, else T.
-
HashHRW::get_site¶ - Type
function(pool:HashHRW::Pool, key:any) :HashHRW::Site- Returns
the site to which the key maps.
-
HashHRW::rem_site¶ - Type
function(pool:HashHRW::Pool, site:HashHRW::Site) :bool
Remove a site from a pool.
- Returns
F if the site is not in the pool, else T.