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

Function writeAttrs

tempodb/encoding/vparquet5/schema.go:547–565  ·  view source on GitHub ↗
(input []*v1.KeyValue, generic *[]Attribute, dedicated *DedicatedAttributes, mapping dedicatedColumnMapping)

Source from the content-addressed store, hash-verified

545}
546
547func writeAttrs(input []*v1.KeyValue, generic *[]Attribute, dedicated *DedicatedAttributes, mapping dedicatedColumnMapping) {
548 *generic = extendReuseSlice(len(input), *generic)
549 dedicated.Reset()
550
551 attrCount := 0
552 for _, a := range input {
553 written := false
554
555 if spareColumn, exists := mapping.get(a.Key); exists {
556 written = spareColumn.writeValue(dedicated, a.Value)
557 }
558
559 if !written {
560 attrToParquet(a, &(*generic)[attrCount])
561 attrCount++
562 }
563 }
564 *generic = (*generic)[:attrCount]
565}
566
567// finalizeTrace augments and optimized the trace by calculating service stats, nested set model bounds
568// and removing redundant scope spans and resource spans. The function returns the modified trace as well

Callers 2

eventToParquetFunction · 0.85

Calls 5

extendReuseSliceFunction · 0.70
attrToParquetFunction · 0.70
ResetMethod · 0.65
getMethod · 0.45
writeValueMethod · 0.45

Tested by

no test coverage detected