Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hasher ¶
type Hasher interface { // Hash returns a 32-bit checksum of the type. Hash() uint32 }
Hasher describes hashable types. In other words, such types that can be used as keys of the hash-table.
type Ring ¶
type Ring interface { // Insert inserts a new element into a ring. After the insertion, // the partition assignments will be re-calculated. Insert(*Element) // Remove removes element from the ring. After the remove, the // partition assignments will be re-calculated. Remove(*Element) // Find searches for element, that is assigned to the given key. Find(Hasher) *Element }
Ring describes types that implement a ring container.
The ring is an implementation of consistent hashing algorithm used for equal balancing of the data between multiple database shards.
type StringHasher ¶
type StringHasher string
StringHasher is an implementation of the Hasher interface that calculates Fowler-Noll-Vo checksum of the string.
Click to show internal directories.
Click to hide internal directories.