Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashRing ¶
type HashRing struct {
// contains filtered or unexported fields
}
HashRing is a token ring that can be used for Consistent Hashing.
Nodes place claims along a TokenRing in a distributed manner (rather than consecutively). This allows for less shuffling during claim changes in the ring. Construction of the ring is deterministic, which allows for multiple processes to have an (eventually) consistent view of the ring.
Users should select a high number of claims for nodes. This is due to the fact that the underlying hash functions aren't 100% uniform. Selecting a larger claim value helps compensate for this fact. As the set of nodes increase, the number of claims per node can decrease (in theory).
func NewHashRing ¶
func NewHashRing() *HashRing