MCPcopy
hub / github.com/grafana/dskit / tokens

Method tokens

ring/partition_ring_model.go:72–81  ·  view source on GitHub ↗

tokens returns a sort list of tokens registered by all partitions.

()

Source from the content-addressed store, hash-verified

70
71// tokens returns a sort list of tokens registered by all partitions.
72func (m *PartitionRingDesc) tokens() Tokens {
73 allTokens := make(Tokens, 0, len(m.Partitions)*optimalTokensPerInstance)
74
75 for _, partition := range m.Partitions {
76 allTokens = append(allTokens, partition.Tokens...)
77 }
78
79 slices.Sort(allTokens)
80 return allTokens
81}
82
83// partitionByToken returns a map where they key is a registered token and the value is ID of the partition
84// that registered that token.

Callers 3

countTokensMethod · 0.95

Calls

no outgoing calls

Tested by 1