Documentation ¶
Index ¶
- Constants
- Variables
- func ActiveServers(cluster string) ([]string, error)
- func Heartbeat(ctx context.Context) error
- func IamLeader(cluster string) (bool, error)
- func NewConsistentHashRing(replicas int32, nodes []string) *consistent.Consistent
- func RebuildConsistentHashRing(cluster string, nodes []string)
- type ClusterHashRingType
Constants ¶
View Source
const NodeReplicas = 500
Variables ¶
View Source
var ClusterHashRing = ClusterHashRingType{Rings: make(map[string]*consistent.Consistent)}
for alert_rule sharding
Functions ¶
func ActiveServers ¶
func NewConsistentHashRing ¶
func NewConsistentHashRing(replicas int32, nodes []string) *consistent.Consistent
Types ¶
type ClusterHashRingType ¶ added in v5.14.3
type ClusterHashRingType struct { sync.RWMutex Rings map[string]*consistent.Consistent }
func (*ClusterHashRingType) GetNode ¶ added in v5.14.3
func (chr *ClusterHashRingType) GetNode(cluster, pk string) (string, error)
func (*ClusterHashRingType) IsHit ¶ added in v5.14.5
func (chr *ClusterHashRingType) IsHit(cluster string, pk string, currentNode string) bool
func (*ClusterHashRingType) Set ¶ added in v5.14.3
func (chr *ClusterHashRingType) Set(cluster string, r *consistent.Consistent)
Click to show internal directories.
Click to hide internal directories.