backend

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMetaDoesNotExist = fmt.Errorf("meta does not exist")
	ErrEmptyTenantID    = fmt.Errorf("empty tenant id")
	ErrEmptyBlockID     = fmt.Errorf("empty block id")
)

Functions

This section is empty.

Types

type AppendTracker

type AppendTracker interface{}

AppendTracker is an empty interface usable by the backend to track a long running append operation

type BlockMeta added in v0.5.0

type BlockMeta struct {
	Version         string    `json:"format"`
	BlockID         uuid.UUID `json:"blockID"`
	MinID           []byte    `json:"minID"`
	MaxID           []byte    `json:"maxID"`
	TenantID        string    `json:"tenantID"`
	StartTime       time.Time `json:"startTime"`
	EndTime         time.Time `json:"endTime"`
	TotalObjects    int       `json:"totalObjects"`
	CompactionLevel uint8     `json:"compactionLevel"`
}

func NewBlockMeta added in v0.5.0

func NewBlockMeta(tenantID string, blockID uuid.UUID) *BlockMeta

func (*BlockMeta) ObjectAdded added in v0.5.0

func (b *BlockMeta) ObjectAdded(id []byte)

type CompactedBlockMeta added in v0.5.0

type CompactedBlockMeta struct {
	BlockMeta

	CompactedTime time.Time `json:"-"`
}

type Compactor

type Compactor interface {
	MarkBlockCompacted(blockID uuid.UUID, tenantID string) error
	ClearBlock(blockID uuid.UUID, tenantID string) error
	CompactedBlockMeta(blockID uuid.UUID, tenantID string) (*CompactedBlockMeta, error)
}

Compactor is a collection of methods to interact with compacted elements of a tempodb block

type Reader

type Reader interface {
	// Reader is for reading entire objects from the backend.  It is expected that there will be an attempt to retrieve this from cache
	Read(ctx context.Context, name string, blockID uuid.UUID, tenantID string) ([]byte, error)
	// ReadRange is for reading parts of large objects from the backend.  It is expected this will _not_ be cached.
	ReadRange(ctx context.Context, name string, blockID uuid.UUID, tenantID string, offset uint64, buffer []byte) error

	Tenants(ctx context.Context) ([]string, error)
	Blocks(ctx context.Context, tenantID string) ([]uuid.UUID, error)
	BlockMeta(ctx context.Context, blockID uuid.UUID, tenantID string) (*BlockMeta, error)

	Shutdown()
}

Reader is a collection of methods to read data from tempodb backends

type Writer

type Writer interface {
	// Write is for in memory data.  It is expected that this data will be cached.
	Write(ctx context.Context, name string, blockID uuid.UUID, tenantID string, buffer []byte) error
	// WriteReader is for larger data payloads streamed through an io.Reader.  It is expected this will _not_ be cached.
	WriteReader(ctx context.Context, name string, blockID uuid.UUID, tenantID string, data io.Reader, size int64) error
	WriteBlockMeta(ctx context.Context, meta *BlockMeta) error

	Append(ctx context.Context, name string, blockID uuid.UUID, tenantID string, tracker AppendTracker, buffer []byte) (AppendTracker, error)
	CloseAppend(ctx context.Context, tracker AppendTracker) error
}

Writer is a collection of methods to write data to tempodb backends

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳