MCPcopy Index your code
hub / github.com/cortexproject/cortex / getTokensInfo

Method getTokensInfo

pkg/ring/model.go:480–502  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

478}
479
480func (d *Desc) getTokensInfo() map[uint32]instanceInfo {
481 out := map[uint32]instanceInfo{}
482
483 instanceIDs := []string{}
484 for key := range d.Ingesters {
485 instanceIDs = append(instanceIDs, key)
486 }
487 sort.Strings(instanceIDs)
488
489 for _, instanceID := range instanceIDs {
490 instance := d.Ingesters[instanceID]
491 info := instanceInfo{
492 InstanceID: instanceID,
493 Zone: instance.Zone,
494 }
495
496 for _, token := range instance.Tokens {
497 out[token] = info
498 }
499 }
500
501 return out
502}
503
504// GetTokens returns sorted list of tokens owned by all instances within the ring.
505func (d *Desc) GetTokens() []uint32 {

Calls

no outgoing calls