VersionedEncoding represents a backend block version, and the methods to read/write them.
| 18 | // VersionedEncoding represents a backend block version, and the methods to |
| 19 | // read/write them. |
| 20 | type 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 |
| 68 | func FromVersion(v string) (VersionedEncoding, error) { |
no outgoing calls
no test coverage detected