MCPcopy
hub / github.com/grafana/tempo / IngesterPartitionID

Function IngesterPartitionID

pkg/ingest/util.go:28–41  ·  view source on GitHub ↗

IngesterPartitionID returns the partition ID owner of the given ingester.

(ingesterID string)

Source from the content-addressed store, hash-verified

26
27// IngesterPartitionID returns the partition ID owner of the given ingester.
28func IngesterPartitionID(ingesterID string) (int32, error) {
29 match := ingesterIDRegexp.FindStringSubmatch(ingesterID)
30 if len(match) == 0 {
31 return 0, fmt.Errorf("ingester ID %s doesn't match regular expression %q", ingesterID, ingesterIDRegexp.String())
32 }
33
34 // Parse the ingester sequence number.
35 ingesterSeq, err := strconv.Atoi(match[1])
36 if err != nil {
37 return 0, fmt.Errorf("no ingester sequence number in ingester ID %s", ingesterID)
38 }
39
40 return int32(ingesterSeq), nil
41}
42
43func LiveStoreConsumerGroupID(instanceID string) (string, error) {
44 match := ingesterIDRegexp.FindStringSubmatch(instanceID)

Callers 2

AssignedPartitionsMethod · 0.92
NewFunction · 0.92

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected