encoding

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2022 License: AGPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyBlock added in v0.7.0

func CopyBlock(ctx context.Context, meta *backend.BlockMeta, from backend.Reader, to backend.Writer) error

CopyBlock from one backend to another. It automatically chooses the encoding for the given block.

func OpenBlock added in v1.5.0

func OpenBlock(meta *backend.BlockMeta, r backend.Reader) (common.BackendBlock, error)

OpenBlock for reading in the backend. It automatically chooes the encoding for the given block.

Types

type VersionedEncoding added in v0.7.0

type VersionedEncoding interface {
	Version() string

	// OpenBlock for reading
	OpenBlock(meta *backend.BlockMeta, r backend.Reader) (common.BackendBlock, error)

	// NewCompactor creates a Compactor that can be used to combine blocks of this
	// encoding. It is expected to use internal details for efficiency.
	NewCompactor(common.CompactionOptions) common.Compactor

	// CreateBlock with the given attributes and trace contents.
	// BlockMeta is used as a container for many options. Required fields:
	// * BlockID
	// * TenantID
	// * Encoding
	// * DataEncoding
	// * StartTime
	// * EndTime
	// * TotalObjects
	CreateBlock(ctx context.Context, cfg *common.BlockConfig, meta *backend.BlockMeta, i common.Iterator, dec model.ObjectDecoder, r backend.Reader, to backend.Writer) (*backend.BlockMeta, error)

	// CopyBlock from one backend to another.
	CopyBlock(ctx context.Context, meta *backend.BlockMeta, from backend.Reader, to backend.Writer) error
}

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

func DefaultEncoding added in v1.5.0

func DefaultEncoding() VersionedEncoding

DefaultEncoding for newly written blocks.

func FromVersion added in v0.7.0

func FromVersion(v string) (VersionedEncoding, error)

FromVersion returns a versioned encoding for the provided string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL