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
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 (*Naming) DeleteInactiveInstances ¶
func (n *Naming) DeleteInactiveInstances()
func (*Naming) Heartbeats ¶
Click to show internal directories.
Click to hide internal directories.