()
| 478 | } |
| 479 | |
| 480 | func (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. |
| 505 | func (d *Desc) GetTokens() []uint32 { |
no outgoing calls