func (this *ConsistentServerSelector) SetServers(servers ...string) error { if this.peers == nil { this.peers = hash.New(2, nil) } this.peers.Add(servers...) return nil }
func (this *ConsistentServerSelector) SetServers(servers ...string) error { if this.nodes == nil { this.nodes = hash.New(32, nil) // TODO config replica } this.nodes.Add(servers...) return nil }
func newPeerPicker(self string) PeerPicker { return &consistentPeerPicker{peers: hash.New(3, nil), Mutex: new(sync.Mutex), self: self} }
func newConsistentPeerSelector() *ConsistentPeerSelector { rand.Seed(time.Now().UnixNano()) return &ConsistentPeerSelector{peers: hash.New(32, nil)} // TODO 32? }