Documentation ¶
Index ¶
Constants ¶
View Source
const (
// 默认虚拟节点
DefaultVirualSpots = 100
)
Variables ¶
This section is empty.
Functions ¶
func CaptureErrGo ¶
func CaptureErrGo(function func(), callBack PanicErr)
捕获err go 协程,callBack 只有panic的时候才会有
Types ¶
type HashRing ¶
type HashRing struct {
// contains filtered or unexported fields
}
HashRing 结构体
func NewHashRing ¶
创建一个hashring 建议值 虚拟节点数 = 已知总节点数 * 100 如果知道总节点数为6 个,那么虚拟节点数值 = 6 *100 差值最小,分布最均匀,差值在千分之5以内
func (*HashRing) UpdateNode ¶
UpdateNode 更新一个节点的权重
Click to show internal directories.
Click to hide internal directories.