Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consistency ¶
type Consistency struct {
// contains filtered or unexported fields
}
Consistency 维护peer与其hash值的关联
func New ¶
func New(replicas int, fn HashFunc) *Consistency
func (*Consistency) GetPeer ¶
func (c *Consistency) GetPeer(key string) string
GetPeer 计算key应缓存到的peer
func (*Consistency) Register ¶
func (c *Consistency) Register(peersName ...string)
Register 将各个peer注册到哈希环上
Click to show internal directories.
Click to hide internal directories.