series

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2019 License: Apache-2.0 Imports: 26 Imported by: 16

Documentation

Overview

Package series is a generated GoMock package.

Package series is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSeriesAllDatapointsExpired is returned on tick when all datapoints are expired
	ErrSeriesAllDatapointsExpired = errors.New("series datapoints are all expired")
)

Functions

func ValidateCachePolicy

func ValidateCachePolicy(v CachePolicy) error

ValidateCachePolicy validates a cache policy.

Types

type BlockState added in v0.8.2

type BlockState struct {
	Retrievable bool
	Version     int
}

BlockState contains the state of a block

type BootstrapResult

type BootstrapResult struct {
	NumBlocksMovedToBuffer int64
	NumBlocksMerged        int64
}

BootstrapResult contains information about the result of bootstrapping a series. It is returned from the series Bootstrap method primarily so the caller can aggregate and emit metrics instead of the series itself having to store additional fields (which would be costly because we have millions of them.)

type BufferBucket added in v0.8.2

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

BufferBucket is a bucket in the buffer.

type BufferBucketPool added in v0.8.2

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

BufferBucketPool provides a pool for BufferBuckets.

func NewBufferBucketPool added in v0.8.2

func NewBufferBucketPool(opts pool.ObjectPoolOptions) *BufferBucketPool

NewBufferBucketPool creates a new BufferBucketPool.

func (*BufferBucketPool) Get added in v0.8.2

func (p *BufferBucketPool) Get() *BufferBucket

Get gets a BufferBucket from the pool.

func (*BufferBucketPool) Put added in v0.8.2

func (p *BufferBucketPool) Put(bucket *BufferBucket)

Put puts a BufferBucket back into the pool.

type BufferBucketVersions added in v0.8.2

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

BufferBucketVersions is a container for different versions (from different flushes to disk) of buffer buckets in the database.

type BufferBucketVersionsPool added in v0.8.2

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

BufferBucketVersionsPool provides a pool for BufferBucketVersions.

func NewBufferBucketVersionsPool added in v0.8.2

func NewBufferBucketVersionsPool(opts pool.ObjectPoolOptions) *BufferBucketVersionsPool

NewBufferBucketVersionsPool creates a new BufferBucketVersionsPool.

func (*BufferBucketVersionsPool) Get added in v0.8.2

Get gets a BufferBucketVersions from the pool.

func (*BufferBucketVersionsPool) Put added in v0.8.2

Put puts a BufferBucketVersions back into the pool.

type CachePolicy

type CachePolicy uint

CachePolicy is the series cache policy.

const (
	// CacheNone specifies that no series will be cached by default.
	CacheNone CachePolicy = iota
	// CacheAll specifies that all series must be cached at all times
	// which requires loading all into cache on bootstrap and never
	// expiring series from memory until expired from retention.
	CacheAll
	// CacheRecentlyRead specifies that series that are recently read
	// must be cached, configurable by the namespace block expiry after
	// not accessed period.
	CacheRecentlyRead
	// CacheLRU specifies that series that are read will be cached
	// using an LRU of fixed capacity. Series that are least recently
	// used will be evicted first.
	CacheLRU

	// DefaultCachePolicy is the default cache policy.
	DefaultCachePolicy = CacheRecentlyRead
)

func ParseCachePolicy

func ParseCachePolicy(str string) (CachePolicy, error)

ParseCachePolicy parses a CachePolicy from a string.

func ValidCachePolicies

func ValidCachePolicies() []CachePolicy

ValidCachePolicies returns the valid series cache policies.

func (CachePolicy) String

func (p CachePolicy) String() string

func (*CachePolicy) UnmarshalYAML

func (p *CachePolicy) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals an CachePolicy into a valid type from string.

type DatabaseSeries

type DatabaseSeries interface {
	block.OnRetrieveBlock
	block.OnEvictedFromWiredList

	// ID returns the ID of the series.
	ID() ident.ID

	// Tags return the tags of the series.
	Tags() ident.Tags

	// Tick executes async updates
	Tick(blockStates map[xtime.UnixNano]BlockState) (TickResult, error)

	// Write writes a new value.
	Write(
		ctx context.Context,
		timestamp time.Time,
		value float64,
		unit xtime.Unit,
		annotation []byte,
		wOpts WriteOptions,
	) (bool, error)

	// ReadEncoded reads encoded blocks.
	ReadEncoded(
		ctx context.Context,
		start, end time.Time,
	) ([][]xio.BlockReader, error)

	// FetchBlocks returns data blocks given a list of block start times.
	FetchBlocks(
		ctx context.Context,
		starts []time.Time,
	) ([]block.FetchBlockResult, error)

	// FetchBlocksMetadata returns the blocks metadata.
	FetchBlocksMetadata(
		ctx context.Context,
		start, end time.Time,
		opts FetchBlocksMetadataOptions,
	) (block.FetchBlocksMetadataResult, error)

	// IsEmpty returns whether series is empty.
	IsEmpty() bool

	// NumActiveBlocks returns the number of active blocks the series currently holds.
	NumActiveBlocks() int

	// IsBootstrapped returns whether the series is bootstrapped or not.
	IsBootstrapped() bool

	// Bootstrap merges the raw series bootstrapped along with any buffered data.
	Bootstrap(blocks block.DatabaseSeriesBlocks) (BootstrapResult, error)

	// Flush flushes the data blocks of this series for a given start time
	Flush(
		ctx context.Context,
		blockStart time.Time,
		persistFn persist.DataFn,
		version int,
	) (FlushOutcome, error)

	// Snapshot snapshots the buffer buckets of this series for any data that has
	// not been rotated into a block yet
	Snapshot(
		ctx context.Context,
		blockStart time.Time,
		persistFn persist.DataFn,
	) error

	// Close will close the series and if pooled returned to the pool.
	Close()

	// Reset resets the series for reuse.
	Reset(
		id ident.ID,
		tags ident.Tags,
		blockRetriever QueryableBlockRetriever,
		onRetrieveBlock block.OnRetrieveBlock,
		onEvictedFromWiredList block.OnEvictedFromWiredList,
		opts Options,
	)
}

DatabaseSeries is a series in the database.

func NewDatabaseSeries

func NewDatabaseSeries(id ident.ID, tags ident.Tags, opts Options) DatabaseSeries

NewDatabaseSeries creates a new database series

type DatabaseSeriesAllocate

type DatabaseSeriesAllocate func() DatabaseSeries

DatabaseSeriesAllocate allocates a database series for a pool.

type DatabaseSeriesPool

type DatabaseSeriesPool interface {
	// Get provides a database series from the pool.
	Get() DatabaseSeries

	// Put returns a database series to the pool.
	Put(block DatabaseSeries)
}

DatabaseSeriesPool provides a pool for database series.

func NewDatabaseSeriesPool

func NewDatabaseSeriesPool(opts pool.ObjectPoolOptions) DatabaseSeriesPool

NewDatabaseSeriesPool creates a new database series pool

type FetchBlocksMetadataOptions

type FetchBlocksMetadataOptions struct {
	block.FetchBlocksMetadataOptions

	// IncludeCachedBlocks specifies whether to also include cached blocks
	// when returning series metadata.
	IncludeCachedBlocks bool
}

FetchBlocksMetadataOptions encapsulates block fetch metadata options and specifies a few series specific options too.

type FlushOutcome

type FlushOutcome int

FlushOutcome is an enum that provides more context about the outcome of series.Flush() to the caller.

const (
	// FlushOutcomeErr is just a default value that can be returned when we're
	// also returning an error.
	FlushOutcomeErr FlushOutcome = iota
	// FlushOutcomeBlockDoesNotExist indicates that the series did not have a
	// block for the specified flush blockStart.
	FlushOutcomeBlockDoesNotExist
	// FlushOutcomeFlushedToDisk indicates that a block existed and was flushed
	// to disk successfully.
	FlushOutcomeFlushedToDisk
)

type MockDatabaseSeries

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

MockDatabaseSeries is a mock of DatabaseSeries interface

func NewMockDatabaseSeries

func NewMockDatabaseSeries(ctrl *gomock.Controller) *MockDatabaseSeries

NewMockDatabaseSeries creates a new mock instance

func (*MockDatabaseSeries) Bootstrap

Bootstrap mocks base method

func (*MockDatabaseSeries) Close

func (m *MockDatabaseSeries) Close()

Close mocks base method

func (*MockDatabaseSeries) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockDatabaseSeries) FetchBlocks

func (m *MockDatabaseSeries) FetchBlocks(arg0 context.Context, arg1 []time.Time) ([]block.FetchBlockResult, error)

FetchBlocks mocks base method

func (*MockDatabaseSeries) FetchBlocksMetadata

FetchBlocksMetadata mocks base method

func (*MockDatabaseSeries) Flush

func (m *MockDatabaseSeries) Flush(arg0 context.Context, arg1 time.Time, arg2 persist.DataFn, arg3 int) (FlushOutcome, error)

Flush mocks base method

func (*MockDatabaseSeries) ID

func (m *MockDatabaseSeries) ID() ident.ID

ID mocks base method

func (*MockDatabaseSeries) IsBootstrapped

func (m *MockDatabaseSeries) IsBootstrapped() bool

IsBootstrapped mocks base method

func (*MockDatabaseSeries) IsEmpty

func (m *MockDatabaseSeries) IsEmpty() bool

IsEmpty mocks base method

func (*MockDatabaseSeries) NumActiveBlocks

func (m *MockDatabaseSeries) NumActiveBlocks() int

NumActiveBlocks mocks base method

func (*MockDatabaseSeries) OnEvictedFromWiredList

func (m *MockDatabaseSeries) OnEvictedFromWiredList(arg0 ident.ID, arg1 time.Time)

OnEvictedFromWiredList mocks base method

func (*MockDatabaseSeries) OnRetrieveBlock

func (m *MockDatabaseSeries) OnRetrieveBlock(arg0 ident.ID, arg1 ident.TagIterator, arg2 time.Time, arg3 ts.Segment)

OnRetrieveBlock mocks base method

func (*MockDatabaseSeries) ReadEncoded

func (m *MockDatabaseSeries) ReadEncoded(arg0 context.Context, arg1, arg2 time.Time) ([][]xio.BlockReader, error)

ReadEncoded mocks base method

func (*MockDatabaseSeries) Reset

Reset mocks base method

func (*MockDatabaseSeries) Snapshot

func (m *MockDatabaseSeries) Snapshot(arg0 context.Context, arg1 time.Time, arg2 persist.DataFn) error

Snapshot mocks base method

func (*MockDatabaseSeries) Tags

func (m *MockDatabaseSeries) Tags() ident.Tags

Tags mocks base method

func (*MockDatabaseSeries) Tick

Tick mocks base method

func (*MockDatabaseSeries) Write

func (m *MockDatabaseSeries) Write(arg0 context.Context, arg1 time.Time, arg2 float64, arg3 time0.Unit, arg4 []byte, arg5 WriteOptions) (bool, error)

Write mocks base method

type MockDatabaseSeriesMockRecorder

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

MockDatabaseSeriesMockRecorder is the mock recorder for MockDatabaseSeries

func (*MockDatabaseSeriesMockRecorder) Bootstrap

func (mr *MockDatabaseSeriesMockRecorder) Bootstrap(arg0 interface{}) *gomock.Call

Bootstrap indicates an expected call of Bootstrap

func (*MockDatabaseSeriesMockRecorder) Close

Close indicates an expected call of Close

func (*MockDatabaseSeriesMockRecorder) FetchBlocks

func (mr *MockDatabaseSeriesMockRecorder) FetchBlocks(arg0, arg1 interface{}) *gomock.Call

FetchBlocks indicates an expected call of FetchBlocks

func (*MockDatabaseSeriesMockRecorder) FetchBlocksMetadata

func (mr *MockDatabaseSeriesMockRecorder) FetchBlocksMetadata(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

FetchBlocksMetadata indicates an expected call of FetchBlocksMetadata

func (*MockDatabaseSeriesMockRecorder) Flush

func (mr *MockDatabaseSeriesMockRecorder) Flush(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

Flush indicates an expected call of Flush

func (*MockDatabaseSeriesMockRecorder) ID

ID indicates an expected call of ID

func (*MockDatabaseSeriesMockRecorder) IsBootstrapped

func (mr *MockDatabaseSeriesMockRecorder) IsBootstrapped() *gomock.Call

IsBootstrapped indicates an expected call of IsBootstrapped

func (*MockDatabaseSeriesMockRecorder) IsEmpty

IsEmpty indicates an expected call of IsEmpty

func (*MockDatabaseSeriesMockRecorder) NumActiveBlocks

func (mr *MockDatabaseSeriesMockRecorder) NumActiveBlocks() *gomock.Call

NumActiveBlocks indicates an expected call of NumActiveBlocks

func (*MockDatabaseSeriesMockRecorder) OnEvictedFromWiredList

func (mr *MockDatabaseSeriesMockRecorder) OnEvictedFromWiredList(arg0, arg1 interface{}) *gomock.Call

OnEvictedFromWiredList indicates an expected call of OnEvictedFromWiredList

func (*MockDatabaseSeriesMockRecorder) OnRetrieveBlock

func (mr *MockDatabaseSeriesMockRecorder) OnRetrieveBlock(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

OnRetrieveBlock indicates an expected call of OnRetrieveBlock

func (*MockDatabaseSeriesMockRecorder) ReadEncoded

func (mr *MockDatabaseSeriesMockRecorder) ReadEncoded(arg0, arg1, arg2 interface{}) *gomock.Call

ReadEncoded indicates an expected call of ReadEncoded

func (*MockDatabaseSeriesMockRecorder) Reset

func (mr *MockDatabaseSeriesMockRecorder) Reset(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call

Reset indicates an expected call of Reset

func (*MockDatabaseSeriesMockRecorder) Snapshot

func (mr *MockDatabaseSeriesMockRecorder) Snapshot(arg0, arg1, arg2 interface{}) *gomock.Call

Snapshot indicates an expected call of Snapshot

func (*MockDatabaseSeriesMockRecorder) Tags

Tags indicates an expected call of Tags

func (*MockDatabaseSeriesMockRecorder) Tick

func (mr *MockDatabaseSeriesMockRecorder) Tick(arg0 interface{}) *gomock.Call

Tick indicates an expected call of Tick

func (*MockDatabaseSeriesMockRecorder) Write

func (mr *MockDatabaseSeriesMockRecorder) Write(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call

Write indicates an expected call of Write

type MockQueryableBlockRetriever

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

MockQueryableBlockRetriever is a mock of QueryableBlockRetriever interface

func NewMockQueryableBlockRetriever

func NewMockQueryableBlockRetriever(ctrl *gomock.Controller) *MockQueryableBlockRetriever

NewMockQueryableBlockRetriever creates a new mock instance

func (*MockQueryableBlockRetriever) BlockStatesSnapshot added in v0.8.2

func (m *MockQueryableBlockRetriever) BlockStatesSnapshot() map[time0.UnixNano]BlockState

BlockStatesSnapshot mocks base method

func (*MockQueryableBlockRetriever) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockQueryableBlockRetriever) IsBlockRetrievable

func (m *MockQueryableBlockRetriever) IsBlockRetrievable(arg0 time.Time) bool

IsBlockRetrievable mocks base method

func (*MockQueryableBlockRetriever) RetrievableBlockVersion added in v0.8.2

func (m *MockQueryableBlockRetriever) RetrievableBlockVersion(arg0 time.Time) int

RetrievableBlockVersion mocks base method

func (*MockQueryableBlockRetriever) Stream

Stream mocks base method

type MockQueryableBlockRetrieverMockRecorder

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

MockQueryableBlockRetrieverMockRecorder is the mock recorder for MockQueryableBlockRetriever

func (*MockQueryableBlockRetrieverMockRecorder) BlockStatesSnapshot added in v0.8.2

func (mr *MockQueryableBlockRetrieverMockRecorder) BlockStatesSnapshot() *gomock.Call

BlockStatesSnapshot indicates an expected call of BlockStatesSnapshot

func (*MockQueryableBlockRetrieverMockRecorder) IsBlockRetrievable

func (mr *MockQueryableBlockRetrieverMockRecorder) IsBlockRetrievable(arg0 interface{}) *gomock.Call

IsBlockRetrievable indicates an expected call of IsBlockRetrievable

func (*MockQueryableBlockRetrieverMockRecorder) RetrievableBlockVersion added in v0.8.2

func (mr *MockQueryableBlockRetrieverMockRecorder) RetrievableBlockVersion(arg0 interface{}) *gomock.Call

RetrievableBlockVersion indicates an expected call of RetrievableBlockVersion

func (*MockQueryableBlockRetrieverMockRecorder) Stream

func (mr *MockQueryableBlockRetrieverMockRecorder) Stream(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

Stream indicates an expected call of Stream

type MockdatabaseBuffer

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

MockdatabaseBuffer is a mock of databaseBuffer interface

func NewMockdatabaseBuffer

func NewMockdatabaseBuffer(ctrl *gomock.Controller) *MockdatabaseBuffer

NewMockdatabaseBuffer creates a new mock instance

func (*MockdatabaseBuffer) Bootstrap

func (m *MockdatabaseBuffer) Bootstrap(bl block.DatabaseBlock)

Bootstrap mocks base method

func (*MockdatabaseBuffer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockdatabaseBuffer) FetchBlocks

func (m *MockdatabaseBuffer) FetchBlocks(ctx context.Context, starts []time.Time) []block.FetchBlockResult

FetchBlocks mocks base method

func (*MockdatabaseBuffer) FetchBlocksMetadata

FetchBlocksMetadata mocks base method

func (*MockdatabaseBuffer) Flush added in v0.8.2

func (m *MockdatabaseBuffer) Flush(ctx context.Context, blockStart time.Time, id ident.ID, tags ident.Tags, persistFn persist.DataFn, version int) (FlushOutcome, error)

Flush mocks base method

func (*MockdatabaseBuffer) IsEmpty

func (m *MockdatabaseBuffer) IsEmpty() bool

IsEmpty mocks base method

func (*MockdatabaseBuffer) ReadEncoded

func (m *MockdatabaseBuffer) ReadEncoded(ctx context.Context, start, end time.Time) ([][]xio.BlockReader, error)

ReadEncoded mocks base method

func (*MockdatabaseBuffer) Reset

func (m *MockdatabaseBuffer) Reset(opts Options)

Reset mocks base method

func (*MockdatabaseBuffer) Snapshot

func (m *MockdatabaseBuffer) Snapshot(ctx context.Context, blockStart time.Time) (xio.SegmentReader, error)

Snapshot mocks base method

func (*MockdatabaseBuffer) Stats

func (m *MockdatabaseBuffer) Stats() bufferStats

Stats mocks base method

func (*MockdatabaseBuffer) Tick

func (m *MockdatabaseBuffer) Tick(versions map[time0.UnixNano]BlockState) bufferTickResult

Tick mocks base method

func (*MockdatabaseBuffer) Write

func (m *MockdatabaseBuffer) Write(ctx context.Context, timestamp time.Time, value float64, unit time0.Unit, annotation []byte, wOpts WriteOptions) (bool, error)

Write mocks base method

type MockdatabaseBufferMockRecorder

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

MockdatabaseBufferMockRecorder is the mock recorder for MockdatabaseBuffer

func (*MockdatabaseBufferMockRecorder) Bootstrap

func (mr *MockdatabaseBufferMockRecorder) Bootstrap(bl interface{}) *gomock.Call

Bootstrap indicates an expected call of Bootstrap

func (*MockdatabaseBufferMockRecorder) FetchBlocks

func (mr *MockdatabaseBufferMockRecorder) FetchBlocks(ctx, starts interface{}) *gomock.Call

FetchBlocks indicates an expected call of FetchBlocks

func (*MockdatabaseBufferMockRecorder) FetchBlocksMetadata

func (mr *MockdatabaseBufferMockRecorder) FetchBlocksMetadata(ctx, start, end, opts interface{}) *gomock.Call

FetchBlocksMetadata indicates an expected call of FetchBlocksMetadata

func (*MockdatabaseBufferMockRecorder) Flush added in v0.8.2

func (mr *MockdatabaseBufferMockRecorder) Flush(ctx, blockStart, id, tags, persistFn, version interface{}) *gomock.Call

Flush indicates an expected call of Flush

func (*MockdatabaseBufferMockRecorder) IsEmpty

IsEmpty indicates an expected call of IsEmpty

func (*MockdatabaseBufferMockRecorder) ReadEncoded

func (mr *MockdatabaseBufferMockRecorder) ReadEncoded(ctx, start, end interface{}) *gomock.Call

ReadEncoded indicates an expected call of ReadEncoded

func (*MockdatabaseBufferMockRecorder) Reset

func (mr *MockdatabaseBufferMockRecorder) Reset(opts interface{}) *gomock.Call

Reset indicates an expected call of Reset

func (*MockdatabaseBufferMockRecorder) Snapshot

func (mr *MockdatabaseBufferMockRecorder) Snapshot(ctx, blockStart interface{}) *gomock.Call

Snapshot indicates an expected call of Snapshot

func (*MockdatabaseBufferMockRecorder) Stats

Stats indicates an expected call of Stats

func (*MockdatabaseBufferMockRecorder) Tick

func (mr *MockdatabaseBufferMockRecorder) Tick(versions interface{}) *gomock.Call

Tick indicates an expected call of Tick

func (*MockdatabaseBufferMockRecorder) Write

func (mr *MockdatabaseBufferMockRecorder) Write(ctx, timestamp, value, unit, annotation, wOpts interface{}) *gomock.Call

Write indicates an expected call of Write

type Options

type Options interface {
	// Validate validates the options
	Validate() error

	// SetClockOptions sets the clock options
	SetClockOptions(value clock.Options) Options

	// ClockOptions returns the clock options
	ClockOptions() clock.Options

	// SetInstrumentOptions sets the instrumentation options
	SetInstrumentOptions(value instrument.Options) Options

	// InstrumentOptions returns the instrumentation options
	InstrumentOptions() instrument.Options

	// SetRetentionOptions sets the retention options
	SetRetentionOptions(value retention.Options) Options

	// RetentionOptions returns the retention options
	RetentionOptions() retention.Options

	// SetDatabaseBlockOptions sets the database block options
	SetDatabaseBlockOptions(value block.Options) Options

	// DatabaseBlockOptions returns the database block options
	DatabaseBlockOptions() block.Options

	// SetCachePolicy sets the series cache policy
	SetCachePolicy(value CachePolicy) Options

	// CachePolicy returns the series cache policy
	CachePolicy() CachePolicy

	// SetContextPool sets the contextPool
	SetContextPool(value context.Pool) Options

	// ContextPool returns the contextPool
	ContextPool() context.Pool

	// SetEncoderPool sets the contextPool
	SetEncoderPool(value encoding.EncoderPool) Options

	// EncoderPool returns the contextPool
	EncoderPool() encoding.EncoderPool

	// SetMultiReaderIteratorPool sets the multiReaderIteratorPool
	SetMultiReaderIteratorPool(value encoding.MultiReaderIteratorPool) Options

	// MultiReaderIteratorPool returns the multiReaderIteratorPool
	MultiReaderIteratorPool() encoding.MultiReaderIteratorPool

	// SetFetchBlockMetadataResultsPool sets the fetchBlockMetadataResultsPool
	SetFetchBlockMetadataResultsPool(value block.FetchBlockMetadataResultsPool) Options

	// FetchBlockMetadataResultsPool returns the fetchBlockMetadataResultsPool
	FetchBlockMetadataResultsPool() block.FetchBlockMetadataResultsPool

	// SetIdentifierPool sets the identifierPool
	SetIdentifierPool(value ident.Pool) Options

	// IdentifierPool returns the identifierPool
	IdentifierPool() ident.Pool

	// SetStats sets the configured Stats.
	SetStats(value Stats) Options

	// Stats returns the configured Stats.
	Stats() Stats

	// SetColdWritesEnabled sets whether cold writes are enabled.
	SetColdWritesEnabled(value bool) Options

	// ColdWritesEnabled returns whether cold writes are enabled.
	ColdWritesEnabled() bool

	// SetBufferBucketVersionsPool sets the BufferBucketVersionsPool.
	SetBufferBucketVersionsPool(value *BufferBucketVersionsPool) Options

	// BufferBucketVersionsPool returns the BufferBucketVersionsPool.
	BufferBucketVersionsPool() *BufferBucketVersionsPool

	// SetBufferBucketPool sets the BufferBucketPool.
	SetBufferBucketPool(value *BufferBucketPool) Options

	// BufferBucketPool returns the BufferBucketPool.
	BufferBucketPool() *BufferBucketPool
}

Options represents the options for series

func NewOptions

func NewOptions() Options

NewOptions creates new database series options

type QueryableBlockRetriever

type QueryableBlockRetriever interface {
	block.DatabaseShardBlockRetriever

	// IsBlockRetrievable returns whether a block is retrievable
	// for a given block start time.
	IsBlockRetrievable(blockStart time.Time) bool

	// RetrievableBlockVersion returns the last time a block was marked success
	RetrievableBlockVersion(blockStart time.Time) int

	// BlockStatesSnapshot returns a snapshot of the whether blocks are
	// retrievable and their flush versions for each block start. This is used
	// to reduce lock contention of acquiring flush state.
	//
	// Flushes may occur and change the actual block state while iterating
	// through this snapshot, so any logic using this function should take this
	// into account.
	BlockStatesSnapshot() map[xtime.UnixNano]BlockState
}

QueryableBlockRetriever is a block retriever that can tell if a block is retrievable or not for a given start time.

type Reader

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

Reader reads results from a series, or a series block retriever or both. It is implemented as a struct so it can be allocated on the stack.

func NewReaderUsingRetriever

func NewReaderUsingRetriever(
	id ident.ID,
	retriever QueryableBlockRetriever,
	onRetrieveBlock block.OnRetrieveBlock,
	onReadBlock block.OnReadBlock,
	opts Options,
) Reader

NewReaderUsingRetriever returns a reader for a series block retriever, it will use the block retriever as the source to read blocks from.

func (Reader) FetchBlocks

func (r Reader) FetchBlocks(
	ctx context.Context,
	starts []time.Time,
) ([]block.FetchBlockResult, error)

FetchBlocks returns data blocks given a list of block start times using just a block retriever.

func (Reader) ReadEncoded

func (r Reader) ReadEncoded(
	ctx context.Context,
	start, end time.Time,
) ([][]xio.BlockReader, error)

ReadEncoded reads encoded blocks using just a block retriever.

type Stats

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

Stats is passed down from namespace/shard to avoid allocations per series.

func NewStats

func NewStats(scope tally.Scope) Stats

NewStats returns a new Stats for the provided scope.

func (Stats) IncCreatedEncoders

func (s Stats) IncCreatedEncoders()

IncCreatedEncoders incs the EncoderCreated stat.

type TickResult

type TickResult struct {
	TickStatus
	// MadeExpiredBlocks is count of blocks just expired.
	MadeExpiredBlocks int
	// MadeUnwiredBlocks is count of blocks just unwired from memory.
	MadeUnwiredBlocks int
	// MergedOutOfOrderBlocks is count of blocks merged from out of order streams.
	MergedOutOfOrderBlocks int
	// EvictedBuckets is count of buckets just evicted from the buffer map.
	EvictedBuckets int
}

TickResult is a set of results from a tick.

type TickStatus

type TickStatus struct {
	// ActiveBlocks is the number of total active blocks.
	ActiveBlocks int
	// WiredBlocks is the number of blocks wired in memory (all data kept)
	WiredBlocks int
	// UnwiredBlocks is the number of blocks unwired (data kept on disk).
	UnwiredBlocks int
	// PendingMergeBlocks is the number of blocks pending merges.
	PendingMergeBlocks int
}

TickStatus is the status of a series for a given tick.

type WriteOptions added in v0.8.2

type WriteOptions struct {
	SchemaDesc namespace.SchemaDescr
}

type WriteType added in v0.8.2

type WriteType int

WriteType is an enum for warm/cold write types.

const (
	// UndefinedWriteType is an undefined write type.
	UndefinedWriteType WriteType = iota

	// WarmWrite represents warm writes (within the buffer past/future window).
	WarmWrite

	// ColdWrite represents cold writes (outside the buffer past/future window).
	ColdWrite
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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