tokens returns a sort list of tokens registered by all partitions.
()
| 70 | |
| 71 | // tokens returns a sort list of tokens registered by all partitions. |
| 72 | func (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. |
no outgoing calls