Documentation ¶
Index ¶
- func BlockIDFromFilename(filename string) string
- type Datastore
- func (ds *Datastore) Blocks() map[string]*block.Block
- func (ds *Datastore) Flush(ctx context.Context)
- func (ds *Datastore) GetBlock(id, endKey string) (*block.Block, error)
- func (ds *Datastore) JoinBlock(ctx context.Context, b *block.Block) (*block.Block, error)
- func (ds *Datastore) NumStreams() uint32
- func (ds *Datastore) NumValues() uint32
- func (ds *Datastore) Reader(ctx context.Context, v *variable.Variable) <-chan *oproto.ValueStream
- func (ds *Datastore) SplitBlock(ctx context.Context, original *block.Block) (*block.Block, *block.Block, error)
- func (ds *Datastore) Writer(ctx context.Context) chan<- *oproto.ValueStream
- type ReadableStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockIDFromFilename ¶
Types ¶
type Datastore ¶
func Open ¶
func Open(ctx context.Context, path string, config store_config.ConfigStore) *Datastore
Open opens a datastore at the supplied path.
func (*Datastore) Flush ¶
Flush ensures that all pending streams are written to disk. Returns once everything is written. Further writes will block until this is completed.
func (*Datastore) NumStreams ¶
func (*Datastore) Reader ¶
Reader builds a channel that will return streams for a supplied Variable. If min/maxTimestamp are not nil, streams will only be returned if SOME values inside the stream match. The supplied variable may be a search or a single. The streams returned may be out of order with respect to variable names or timestamps.
func (*Datastore) SplitBlock ¶
func (ds *Datastore) SplitBlock(ctx context.Context, original *block.Block) (*block.Block, *block.Block, error)
SplitBlock splits a single block into multiple (usually 2) smaller blocks. The new blocks' contents are immedately written to disk and reopened by the Datatstore. The old block is removed from disk once the new contents are available. This will block writes to a block for the duration of the reindexing.
func (*Datastore) Writer ¶
func (ds *Datastore) Writer(ctx context.Context) chan<- *oproto.ValueStream
Writer builds a channel that can accept ValueStreams for writing to the datastore. Any ValueStreams written to this channel will eventually be flushed to disk, but they will be immediately available for use. The writes to disk are not guaranteed until Flush is called.
type ReadableStore ¶
type ReadableStore interface { // Reader builds a channel that will return streams for a supplied Variable. // If min/maxTimestamp are not nil, streams will only be returned if SOME values inside the stream match. // The supplied variable may be a search or a single. // The streams returned may be out of order with respect to variable names or timestamps. Reader(ctx context.Context, v *variable.Variable) <-chan *oproto.ValueStream }