chunkenc

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: Apache-2.0 Imports: 7 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Appender

type Appender interface {
	Append(int64, interface{})
	Chunk() Chunk
	Encoding() Encoding
}

Appender adds metric-sample pairs to a chunk.

type Chunk

type Chunk interface {
	Bytes() []byte
	Clear()
	Encoding() Encoding
	Appender() (Appender, error)
	Iterator() Iterator
}

Chunk holds a sequence of sample pairs that can be iterated over and appended to.

func FromData

func FromData(logger logger.Logger, e Encoding, d []byte, samples uint16) (Chunk, error)

FromData returns a chunk from a byte slice of chunk data.

func NewChunk added in v0.8.4

func NewChunk(logger logger.Logger, variant bool) Chunk

type Encoding

type Encoding uint8

Encoding is the identifier for chunk encoding.

const (
	EncNone    Encoding = 0
	EncXOR     Encoding = 1
	EncVariant Encoding = 2
)

Available chunk encodings

func (Encoding) String

func (e Encoding) String() string

type Iterator

type Iterator interface {
	At() (int64, float64)
	AtString() (int64, string)
	Err() error
	Next() bool
}

Iterator is a simple iterator that can only get the next value.

func NewNopIterator

func NewNopIterator() Iterator

NewNopIterator returns a new chunk iterator that doesn't hold any data.

type VarChunk added in v0.8.4

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

func (*VarChunk) Appender added in v0.8.4

func (c *VarChunk) Appender() (Appender, error)

Appender implements the Chunk interface.

func (*VarChunk) Bytes added in v0.8.4

func (c *VarChunk) Bytes() []byte

Bytes returns the underlying byte slice of the chunk.

func (*VarChunk) Clear added in v0.8.4

func (c *VarChunk) Clear()

func (*VarChunk) Encoding added in v0.8.4

func (c *VarChunk) Encoding() Encoding

Encoding returns the encoding type.

func (*VarChunk) Iterator added in v0.8.4

func (c *VarChunk) Iterator() Iterator

Iterator implements the Chunk interface.

type XORChunk

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

XORChunk holds XOR encoded sample data.

func (*XORChunk) Appender

func (c *XORChunk) Appender() (Appender, error)

Appender implements the Chunk interface. new implementation, doesnt read the existing buffer, assume its new

func (*XORChunk) Bytes

func (c *XORChunk) Bytes() []byte

Bytes returns the underlying byte slice of the chunk.

func (*XORChunk) Clear

func (c *XORChunk) Clear()

func (*XORChunk) Encoding

func (c *XORChunk) Encoding() Encoding

Encoding returns the encoding type.

func (*XORChunk) Iterator

func (c *XORChunk) Iterator() Iterator

Iterator implements the Chunk interface.

Jump to

Keyboard shortcuts

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