naming

package
v5.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const NodeReplicas = 500

Variables

for alert_rule sharding

Functions

func ActiveServers

func ActiveServers(ctx context.Context, cluster string) ([]string, error)

func Heartbeat

func Heartbeat(ctx context.Context) error

func IamLeader

func IamLeader() (bool, error)

func RebuildConsistentHashRing

func RebuildConsistentHashRing(nodes []string)

Types

type ConsistentHashRing

type ConsistentHashRing struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewConsistentHashRing

func NewConsistentHashRing(replicas int32, nodes []string) *ConsistentHashRing

func (*ConsistentHashRing) GetNode

func (chr *ConsistentHashRing) GetNode(pk string) (string, error)

func (*ConsistentHashRing) GetRing

func (chr *ConsistentHashRing) GetRing() *consistent.Consistent

func (*ConsistentHashRing) Set

Jump to

Keyboard shortcuts

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