Documentation ¶
Overview ¶
Package consistenthash provides an implementation of a ring hash.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Map tracks segments in a hash-ring, mapped to specific keys.
func (*Map) Add ¶
Add adds some keys to the hashring, establishing ownership of segsPerKey segments.
func (*Map) GetReplicated ¶
GetReplicated gets the closest item in the hash to a deterministic set of keyReplicas variations of the provided key. The returned set of segment-owning keys is dedup'd, and collisions are resolved by traversing backwards in the hash-ring to find an unused owning-key.
Click to show internal directories.
Click to hide internal directories.