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

Function parseName

tempodb/encoding/vparquet3/wal_block.go:897–923  ·  view source on GitHub ↗

<blockID>+<tenantID>+vParquet

(filename string)

Source from the content-addressed store, hash-verified

895
896// <blockID>+<tenantID>+vParquet
897func parseName(filename string) (uuid.UUID, string, string, error) {
898 splits := strings.Split(filename, "+")
899
900 if len(splits) != 3 {
901 return uuid.UUID{}, "", "", fmt.Errorf("unable to parse %s. unexpected number of segments", filename)
902 }
903
904 // first segment is blockID
905 id, err := uuid.Parse(splits[0])
906 if err != nil {
907 return uuid.UUID{}, "", "", fmt.Errorf("unable to parse %s. error parsing uuid: %w", filename, err)
908 }
909
910 // second segment is tenant
911 tenant := splits[1]
912 if len(tenant) == 0 {
913 return uuid.UUID{}, "", "", fmt.Errorf("unable to parse %s. 0 length tenant", filename)
914 }
915
916 // third segment is version
917 version := splits[2]
918 if version != VersionString {
919 return uuid.UUID{}, "", "", fmt.Errorf("unable to parse %s. unexpected version %s", filename, version)
920 }
921
922 return id, tenant, version, nil
923}
924
925// rowIterator is used to iterate a parquet file and implement iterIterator
926// traces are iterated according to the given row numbers, because there is

Callers 3

openWALBlockFunction · 0.70
ownsWALBlockFunction · 0.70
TestParseFilenameFunction · 0.70

Calls 1

ParseMethod · 0.65

Tested by 1

TestParseFilenameFunction · 0.56