naming

package
v5.0.0-ga-04 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: Apache-2.0 Imports: 10 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, cfg HeartbeatConfig) 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

type HeartbeatConfig

type HeartbeatConfig struct {
	IP       string
	Interval int64
	Endpoint string
	Cluster  string
}

Jump to

Keyboard shortcuts

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