Documentation ¶
Index ¶
- Constants
- Variables
- func NewConsistentHashRing(replicas int32, nodes []string) *consistent.Consistent
- func RebuildConsistentHashRing(datasourceId int64, nodes []string)
- type DatasourceHashRingType
- func (chr *DatasourceHashRingType) Clear()
- func (chr *DatasourceHashRingType) GetNode(datasourceId int64, pk string) (string, error)
- func (chr *DatasourceHashRingType) IsHit(datasourceId int64, pk string, currentNode string) bool
- func (chr *DatasourceHashRingType) Set(datasourceId int64, r *consistent.Consistent)
- type Naming
Constants ¶
View Source
const NodeReplicas = 500
Variables ¶
View Source
var DatasourceHashRing = DatasourceHashRingType{Rings: make(map[int64]*consistent.Consistent)}
View Source
var HostDatasource int64 = 99999999
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) Clear ¶
func (chr *DatasourceHashRingType) Clear()
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) ActiveServersByEngineName ¶
func (*Naming) DeleteInactiveInstances ¶
func (n *Naming) DeleteInactiveInstances()
func (*Naming) Heartbeats ¶
Click to show internal directories.
Click to hide internal directories.