b1 - ActiveState ActiveGo 1.8

Package b1

import "github.com/influxdata/influxdb/cmd/influx_tsm/b1"

Overview ▾

Package b1 reads data from b1 shards.


DefaultChunkSize is the size of chunks read from the b1 shard

const DefaultChunkSize int = 1000

type Reader

Reader is used to read all data from a b1 shard.

type Reader struct {
    // contains filtered or unexported fields

func NewReader

func NewReader(path string, stats *stats.Stats, chunkSize int) *Reader

NewReader returns a reader for the b1 shard at path.

func (*Reader) Close

func (r *Reader) Close() error

Close closes the reader.

func (*Reader) Next

func (r *Reader) Next() bool

Next returns whether any data remains to be read. It must be called before the next call to Read().

func (*Reader) Open

func (r *Reader) Open() error

Open opens the reader.

func (*Reader) Read

func (r *Reader) Read() (string, []tsm1.Value, error)

Read returns the next chunk of data in the shard, converted to tsm1 values. Data is emitted completely for every field, in every series, before the next field is processed. Data from Read() adheres to the requirements for writing to tsm1 shards