Documentation ¶
Index ¶
- Variables
- type Hash
- func (m *Hash) Get(key string) (string, error)
- func (m *Hash) GetAny(key string) (string, error)
- func (m *Hash) GetKeyShardId(key string) (int, error)
- func (m *Hash) GetReplicas(id int) []string
- func (m *Hash) GetReplicationFactor() int
- func (m *Hash) GetShardId(member string) int
- func (m *Hash) GetView() types.View
- func (m *Hash) Members() []string
- func (m *Hash) TestAndSet(view types.View) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoElements = errors.New("No elements to hash to")
)
Functions ¶
This section is empty.
Types ¶
type Hash ¶
type Hash struct {
// contains filtered or unexported fields
}
Hash implements simple modulo hashing.
func (*Hash) GetAny ¶
GetAny returns any node that should be able to service a given key, even if that node is not the primary for a given key.
func (*Hash) GetKeyShardId ¶
GetKeyShardId returns the shard that a key belongs to.
func (*Hash) GetReplicas ¶
GetReplicas returns the set of members in the given shard.
func (*Hash) GetReplicationFactor ¶
func (*Hash) GetShardId ¶
GetShardId returns the shard ID of the given member.
Click to show internal directories.
Click to hide internal directories.