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

Function parseName

tempodb/encoding/unsupported/wal.go:26–49  ·  view source on GitHub ↗
(filename string)

Source from the content-addressed store, hash-verified

24}
25
26func parseName(filename string) (uuid.UUID, string, string, error) {
27 splits := strings.Split(filename, "+")
28
29 if len(splits) != 3 {
30 return uuid.UUID{}, "", "", fmt.Errorf("unable to parse %s. unexpected number of segments", filename)
31 }
32
33 // first segment is blockID
34 id, err := uuid.Parse(splits[0])
35 if err != nil {
36 return uuid.UUID{}, "", "", fmt.Errorf("unable to parse %s. error parsing uuid: %w", filename, err)
37 }
38
39 // second segment is tenant
40 tenant := splits[1]
41 if len(tenant) == 0 {
42 return uuid.UUID{}, "", "", fmt.Errorf("unable to parse %s. 0 length tenant", filename)
43 }
44
45 // third segment is version
46 version := splits[2]
47
48 return id, tenant, version, nil
49}

Callers 1

ownsWALBlockFunction · 0.70

Calls 1

ParseMethod · 0.65

Tested by

no test coverage detected