Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsistentHashNodeRing ¶
type ConsistentHashNodeRing struct {
// contains filtered or unexported fields
}
一致性哈希环,用于管理服务器节点.
func NewConsistentHashNodesRing ¶
func NewConsistentHashNodesRing(numberOfReplicas int32, nodes []string) *ConsistentHashNodeRing
func (*ConsistentHashNodeRing) GetNode ¶
func (this *ConsistentHashNodeRing) GetNode(pk string) (string, error)
根据pk,获取node节点. chash(pk) -> node
func (*ConsistentHashNodeRing) SetNodes ¶
func (this *ConsistentHashNodeRing) SetNodes(nodes []string)
func (*ConsistentHashNodeRing) SetNumberOfReplicas ¶
func (this *ConsistentHashNodeRing) SetNumberOfReplicas(num int32)
Click to show internal directories.
Click to hide internal directories.