encoding

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateConfig added in v0.6.0

func ValidateConfig(b *BlockConfig) error

ValidateConfig returns true if the config is valid

Types

type BackendBlock added in v0.5.0

type BackendBlock struct {
	// contains filtered or unexported fields
}

BackendBlock represents a block already in the backend.

func NewBackendBlock added in v0.5.0

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

NewBackendBlock returns a BackendBlock for the given backend.BlockMeta

It is version aware.

func (*BackendBlock) Find added in v0.5.0

func (b *BackendBlock) Find(ctx context.Context, id common.ID) ([]byte, error)

Find searches a block for the ID and returns an object if found.

func (*BackendBlock) Iterator added in v0.6.0

func (b *BackendBlock) Iterator(chunkSizeBytes uint32) (common.Iterator, error)

Iterator returns an Iterator that iterates over the objects in the block from the backend

type BlockConfig added in v0.6.0

type BlockConfig struct {
	IndexDownsampleBytes int              `yaml:"index_downsample_bytes"`
	BloomFP              float64          `yaml:"bloom_filter_false_positive"`
	Encoding             backend.Encoding `yaml:"encoding"`
}

BlockConfig holds configuration options for newly created blocks

type CompactorBlock added in v0.5.0

type CompactorBlock struct {
	// contains filtered or unexported fields
}

func NewCompactorBlock added in v0.5.0

func NewCompactorBlock(cfg *BlockConfig, id uuid.UUID, tenantID string, metas []*backend.BlockMeta, estimatedObjects int) (*CompactorBlock, error)

NewCompactorBlock creates a ... new compactor block!

func (*CompactorBlock) AddObject added in v0.5.0

func (c *CompactorBlock) AddObject(id common.ID, object []byte) error

func (*CompactorBlock) BlockMeta added in v0.5.0

func (c *CompactorBlock) BlockMeta() *backend.BlockMeta

func (*CompactorBlock) Complete added in v0.5.0

func (c *CompactorBlock) Complete(ctx context.Context, tracker backend.AppendTracker, w backend.Writer) (int, error)

Complete finishes writes the compactor metadata and closes all buffers and appenders

func (*CompactorBlock) CurrentBufferLength added in v0.5.0

func (c *CompactorBlock) CurrentBufferLength() int

func (*CompactorBlock) CurrentBufferedObjects added in v0.5.0

func (c *CompactorBlock) CurrentBufferedObjects() int

func (*CompactorBlock) FlushBuffer added in v0.5.0

FlushBuffer flushes any existing objects to the backend

func (*CompactorBlock) Length added in v0.5.0

func (c *CompactorBlock) Length() int

type CompleteBlock added in v0.5.0

type CompleteBlock struct {
	// contains filtered or unexported fields
}

CompleteBlock represent a block that has been "cut", is ready to be flushed and is not appendable. A CompleteBlock also knows the filepath of the append wal file it was cut from. It is responsible for cleaning this block up once it has been flushed to the backend.

func NewCompleteBlock added in v0.5.0

func NewCompleteBlock(cfg *BlockConfig, originatingMeta *backend.BlockMeta, iterator common.Iterator, estimatedObjects int, filepath string, walFilename string) (*CompleteBlock, error)

NewCompleteBlock creates a new block and takes _ALL_ the parameters necessary to build the ordered, deduped file on disk

func (*CompleteBlock) BlockMeta added in v0.5.0

func (c *CompleteBlock) BlockMeta() *backend.BlockMeta

BlockMeta returns a pointer to this blocks meta

func (*CompleteBlock) Clear added in v0.5.0

func (c *CompleteBlock) Clear() error

Clear removes the backing file.

func (*CompleteBlock) Find added in v0.5.0

func (c *CompleteBlock) Find(id common.ID, combiner common.ObjectCombiner) ([]byte, error)

Find searches the for the provided trace id. A CompleteBlock should never

have multiples of a single id so not sure why this uses a DedupingFinder.

func (*CompleteBlock) FlushedTime added in v0.5.0

func (c *CompleteBlock) FlushedTime() time.Time

FlushedTime returns the time the block was flushed. Will return 0

if the block was never flushed

func (*CompleteBlock) Write added in v0.5.0

func (c *CompleteBlock) Write(ctx context.Context, w backend.Writer) error

Write implements WriteableBlock

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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