naming

package
v6.0.0-ga.3 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const NodeReplicas = 500

Variables

View Source
var DatasourceHashRing = DatasourceHashRingType{Rings: make(map[int64]*consistent.Consistent)}
View Source
var HostDatasource int64 = 100000

for alert_rule sharding

Functions

func NewConsistentHashRing

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

func RebuildConsistentHashRing

func RebuildConsistentHashRing(datasourceId int64, nodes []string)

Types

type DatasourceHashRingType

type DatasourceHashRingType struct {
	sync.RWMutex
	Rings map[int64]*consistent.Consistent
}

func (*DatasourceHashRingType) GetNode

func (chr *DatasourceHashRingType) GetNode(datasourceId int64, pk string) (string, error)

func (*DatasourceHashRingType) IsHit

func (chr *DatasourceHashRingType) IsHit(datasourceId int64, pk string, currentNode string) bool

func (*DatasourceHashRingType) Set

func (chr *DatasourceHashRingType) Set(datasourceId int64, r *consistent.Consistent)

type Naming

type Naming struct {
	// contains filtered or unexported fields
}

func NewNaming

func NewNaming(ctx *ctx.Context, heartbeat aconf.HeartbeatConfig, isCenter bool) *Naming

func (*Naming) ActiveServers

func (n *Naming) ActiveServers(datasourceId int64) ([]string, error)

func (*Naming) DeleteInactiveInstances

func (n *Naming) DeleteInactiveInstances()

func (*Naming) Heartbeats

func (n *Naming) Heartbeats() error

Jump to

Keyboard shortcuts

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