rings

package
Version: v0.0.0-...-a6f56a6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2015 License: MIT Imports: 1 Imported by: 82

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)

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL