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

Interface VersionedEncoding

tempodb/encoding/versioned.go:20–65  ·  tempodb/encoding/versioned.go::VersionedEncoding

VersionedEncoding represents a backend block version, and the methods to read/write them.

Source from the content-addressed store, hash-verified

18// VersionedEncoding represents a backend block version, and the methods to
19// read/write them.
20type VersionedEncoding interface {
21 Version() string
22
23 // OpenBlock for reading
24 OpenBlock(meta *backend.BlockMeta, r backend.Reader) (common.BackendBlock, error)
25
26 // NewCompactor creates a Compactor that can be used to combine blocks of this
27 // encoding. It is expected to use internal details for efficiency.
28 NewCompactor(common.CompactionOptions) common.Compactor
29
30 // Feature detection methods:
31 CompactionSupported() bool // Whether these blocks should be compacted, if false the compactor will ignore these.
32 WritesSupported() bool // Whether this encoding can create new blocks, or is in deprecated read-only mode.
33
34 // CreateBlock with the given attributes and trace contents.
35 // BlockMeta is used as a container for many options. Required fields:
36 // * BlockID
37 // * TenantID
38 // * Encoding
39 // * StartTime
40 // * EndTime
41 // * TotalObjects
42 CreateBlock(ctx context.Context, cfg *common.BlockConfig, meta *backend.BlockMeta, i common.Iterator, r backend.Reader, to backend.Writer) (*backend.BlockMeta, error)
43
44 // CopyBlock from one backend to another.
45 CopyBlock(ctx context.Context, meta *backend.BlockMeta, from backend.Reader, to backend.Writer) error
46
47 // MigrateBlock from one backend and tenant to another.
48 MigrateBlock(ctx context.Context, fromMeta, toMeta *backend.BlockMeta, from backend.Reader, to backend.Writer) error
49
50 // OpenWALBlock opens an existing appendable block for the WAL
51 OpenWALBlock(filename, path string, ingestionSlack, additionalStartSlack time.Duration) (common.WALBlock, error, error)
52
53 // CreateWALBlock creates a new appendable block for the WAL
54 //
55 // BlockMeta is used as a container for many options. Required fields:
56 // * BlockID
57 // * TenantID
58 // * Encoding
59 // * DedicatedColumns (vParquet3)
60 // * ReplicationFactor (Optional)
61 CreateWALBlock(meta *backend.BlockMeta, filepath, dataEncoding string, ingestionSlack time.Duration) (common.WALBlock, error)
62
63 // OwnsWALBlock indicates if this encoding owns the WAL block
64 OwnsWALBlock(entry fs.DirEntry) bool
65}
66
67// FromVersion returns a versioned encoding for the provided string
68func FromVersion(v string) (VersionedEncoding, error) {

Callers 29

testConfigFunction · 0.65
TestCompleteBlockFunction · 0.65
BenchmarkCompleteBlockFunction · 0.65
benchmarkCompleteBlockFunction · 0.65
TestCompactionRoundtripFunction · 0.65
TestSameIDCompactionFunction · 0.65
OpenBlockFunction · 0.65
FlushMethod · 0.65
completeBlockMethod · 0.65

Implementers 4

Encodingtempodb/encoding/vparquet4/encoding.go
Encodingtempodb/encoding/vparquet5/encoding.go
Encodingtempodb/encoding/vparquet3/encoding.go
Encodingtempodb/encoding/unsupported/encoding.

Calls

no outgoing calls

Tested by

no test coverage detected