Documentation ¶
Index ¶
Constants ¶
View Source
const DEFAULT_REPLICAS = 10000
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Consistent ¶
type Consistent struct { Nodes map[uint32]Node Resources map[int]bool sync.RWMutex // contains filtered or unexported fields }
func NewConsistent ¶
func NewConsistent() *Consistent
func (*Consistent) Add ¶
func (c *Consistent) Add(node *Node) bool
func (*Consistent) Get ¶
func (c *Consistent) Get(key string) Node
数据分配,根据key计算出的hash值确定 这个key由哪个节点承载
func (*Consistent) Remove ¶
func (c *Consistent) Remove(node *Node)
Click to show internal directories.
Click to hide internal directories.