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

Function CoalesceVersion

tempodb/encoding/versioned.go:140–148  ·  view source on GitHub ↗

CoalesceVersion resolves a block encoding version from a chain of version strings ordered lowest to highest priority. Empty strings are skipped. Falls back to DefaultEncoding if all are empty. Returns the validated VersionedEncoding suitable for writes.

(versions ...string)

Source from the content-addressed store, hash-verified

138// Falls back to DefaultEncoding if all are empty.
139// Returns the validated VersionedEncoding suitable for writes.
140func CoalesceVersion(versions ...string) (VersionedEncoding, error) {
141 ver := DefaultEncoding().Version()
142 for _, v := range versions {
143 if v != "" {
144 ver = v
145 }
146 }
147 return FromVersionForWrites(ver)
148}
149
150// CopyBlock from one backend to another. It automatically chooses the encoding for the given block.
151func CopyBlock(ctx context.Context, meta *backend.BlockMeta, from backend.Reader, to backend.Writer) error {

Callers 1

TestCoalesceVersionFunction · 0.85

Calls 3

DefaultEncodingFunction · 0.85
FromVersionForWritesFunction · 0.85
VersionMethod · 0.65

Tested by 1

TestCoalesceVersionFunction · 0.68