Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsistentHash ¶
type ConsistentHash struct {
// contains filtered or unexported fields
}
ConsistentHash See the following docs: - https://www.eecs.umich.edu/techreports/cse/96/CSE-TR-316-96.pdf - https://github.com/dgryski/go-rendezvous - https://dgryski.medium.com/consistent-hashing-algorithmic-tradeoffs-ef6b8e2fcae8
func NewConsistentHash ¶
func NewConsistentHash(nodes []string, hashSeed uint64) *ConsistentHash
NewConsistentHash creates a consistent hash based on the nodes.
func (*ConsistentHash) GetNodeIdx ¶
func (rh *ConsistentHash) GetNodeIdx(h uint64, excludeIdxs []int) int
GetNodeIdx returns the node index that the input hash value should belong to.
Click to show internal directories.
Click to hide internal directories.