chunks

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MagicChunks is 4 bytes at the head of a series file.
	MagicChunks = 0x85BD40DD
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteSlice

type ByteSlice interface {
	Len() int
	Range(start, end int) []byte
}

ByteSlice abstracts a byte slice.

type Meta

type Meta struct {
	// Ref and Chunk hold either a reference that can be used to retrieve
	// chunk data or the data itself.
	// Generally, only one of them is set.
	Ref   uint64
	Chunk chunkenc.Chunk

	MinTime, MaxTime int64 // time range the data covers
}

Meta holds information about a chunk of data.

func (*Meta) OverlapsClosedInterval

func (cm *Meta) OverlapsClosedInterval(mint, maxt int64) bool

Returns true if the chunk overlaps [mint, maxt].

type Reader

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

Reader implements a SeriesReader for a serialized byte stream of series data.

func NewDirReader

func NewDirReader(dir string, pool chunkenc.Pool) (*Reader, error)

NewDirReader returns a new Reader against sequentially numbered files in the given directory.

func NewReader

func NewReader(bs []ByteSlice, pool chunkenc.Pool) (*Reader, error)

NewReader returns a new chunk reader against the given byte slices.

func (*Reader) Chunk

func (s *Reader) Chunk(ref uint64) (chunkenc.Chunk, error)

func (*Reader) Close

func (s *Reader) Close() error

type Writer

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

Writer implements the ChunkWriter interface for the standard serialization format.

func NewWriter

func NewWriter(dir string) (*Writer, error)

NewWriter returns a new writer against the given directory.

func (*Writer) Close

func (w *Writer) Close() error

func (*Writer) WriteChunks

func (w *Writer) WriteChunks(chks ...Meta) error

Jump to

Keyboard shortcuts

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