naming

package
v5.14.3 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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 ActiveServers(cluster string) ([]string, error)

func Heartbeat

func Heartbeat(ctx context.Context) error

func IamLeader

func IamLeader(cluster string) (bool, error)

func NewConsistentHashRing

func NewConsistentHashRing(replicas int32, nodes []string) *consistent.Consistent

func RebuildConsistentHashRing

func RebuildConsistentHashRing(cluster string, nodes []string)

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) Set added in v5.14.3

func (chr *ClusterHashRingType) Set(cluster string, r *consistent.Consistent)

Jump to

Keyboard shortcuts

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