Documentation
¶
Index ¶
- func ToDocMetadata(seriesBlock SeriesBlock) []doc.Metadata
- func WriteAllPredicate(_ TestValue) bool
- type AnnotationGenerator
- type BlockConfig
- type Options
- type Series
- type SeriesBlock
- type SeriesBlocksByStart
- type SeriesDataPoint
- type SeriesDataPointsByTime
- type TestValue
- type UpdateBlockConfig
- type WriteDatapointPredicate
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToDocMetadata ¶ added in v1.2.0
func ToDocMetadata(seriesBlock SeriesBlock) []doc.Metadata
ToDocMetadata converts a SeriesBlock to []doc.Metadata
func WriteAllPredicate ¶ added in v0.4.0
WriteAllPredicate writes all datapoints
Types ¶
type AnnotationGenerator ¶ added in v0.9.2
type AnnotationGenerator interface {
Next() []byte
}
AnnotationGenerator generates the next annotation.
type BlockConfig ¶
type BlockConfig struct {
IDs []string
Tags ident.Tags
NumPoints int
Start xtime.UnixNano
AnnGen AnnotationGenerator
}
BlockConfig represents the configuration to generate a SeriesBlock.
type Options ¶
type Options interface {
// SetClockOptions sets the clock options.
SetClockOptions(value clock.Options) Options
// ClockOptions returns the clock options.
ClockOptions() clock.Options
// SetRetentionPeriod sets how long we intend to keep data in memory.
SetRetentionPeriod(value time.Duration) Options
// RetentionPeriod returns how long we intend to keep data in memory.
RetentionPeriod() time.Duration
// SetBlockSize sets the blockSize.
SetBlockSize(value time.Duration) Options
// BlockSize returns the blockSize.
BlockSize() time.Duration
// SetFilePathPrefix sets the file path prefix for sharded TSDB files.
SetFilePathPrefix(value string) Options
// FilePathPrefix returns the file path prefix for sharded TSDB files.
FilePathPrefix() string
// SetNewFileMode sets the new file mode.
SetNewFileMode(value os.FileMode) Options
// NewFileMode returns the new file mode.
NewFileMode() os.FileMode
// SetNewDirectoryMode sets the new directory mode.
SetNewDirectoryMode(value os.FileMode) Options
// NewDirectoryMode returns the new directory mode.
NewDirectoryMode() os.FileMode
// SetWriterBufferSize sets the buffer size for writing TSDB files.
SetWriterBufferSize(value int) Options
// WriterBufferSize returns the buffer size for writing TSDB files.
WriterBufferSize() int
// SetWriteEmptyShards sets whether writes are done even for empty start periods.
SetWriteEmptyShards(bool) Options
// WriteEmptyShards returns whether writes are done even for empty start periods.
WriteEmptyShards() bool
// SetWriteSnapshot sets whether writes are written as snapshot files.
SetWriteSnapshot(bool) Options
// WriteSnapshots returns whether writes are written as snapshot files.
WriteSnapshot() bool
// SetEncoderPool sets the contextPool.
SetEncoderPool(value encoding.EncoderPool) Options
// EncoderPool returns the contextPool.
EncoderPool() encoding.EncoderPool
}
Options represent the parameters needed for the Writer.
type SeriesBlock ¶
type SeriesBlock []Series
SeriesBlock is a collection of Series.
func Block ¶
func Block(conf BlockConfig) SeriesBlock
Block generates a SeriesBlock based on provided config
func (SeriesBlock) Less ¶
func (l SeriesBlock) Less(i, j int) bool
func (SeriesBlock) Swap ¶
func (l SeriesBlock) Swap(i, j int)
type SeriesBlocksByStart ¶
type SeriesBlocksByStart map[xtime.UnixNano]SeriesBlock
SeriesBlocksByStart is a map of time -> SeriesBlock.
func BlocksByStart ¶
func BlocksByStart(confs []BlockConfig) SeriesBlocksByStart
BlocksByStart generates a map of SeriesBlocks keyed by Start time for the provided configs
type SeriesDataPoint ¶
SeriesDataPoint represents a single data point of a generated series of data.
type SeriesDataPointsByTime ¶
type SeriesDataPointsByTime []SeriesDataPoint
SeriesDataPointsByTime are a sorted list of SeriesDataPoints.
func ToPointsByTime ¶
func ToPointsByTime(seriesMaps SeriesBlocksByStart) SeriesDataPointsByTime
ToPointsByTime converts a SeriesBlocksByStart to SeriesDataPointsByTime
func (SeriesDataPointsByTime) Dearrange ¶
func (l SeriesDataPointsByTime) Dearrange(percent float64) SeriesDataPointsByTime
Dearrange de-arranges the list by the defined percent.
func (SeriesDataPointsByTime) Len ¶
func (l SeriesDataPointsByTime) Len() int
func (SeriesDataPointsByTime) Less ¶
func (l SeriesDataPointsByTime) Less(i, j int) bool
func (SeriesDataPointsByTime) Swap ¶
func (l SeriesDataPointsByTime) Swap(i, j int)
type TestValue ¶ added in v0.9.2
type TestValue struct {
ts.Datapoint
ts.Annotation
}
TestValue is a test datapoint and an annotation.
type UpdateBlockConfig ¶ added in v0.9.2
type UpdateBlockConfig func([]BlockConfig)
UpdateBlockConfig is a function used o update BlockConfigs.
type WriteDatapointPredicate ¶ added in v0.4.0
WriteDatapointPredicate returns a boolean indicating whether a datapoint should be written.
type Writer ¶
type Writer interface {
// WriteData writes the data as data files.
WriteData(
nsCtx ns.Context,
shards sharding.ShardSet,
data SeriesBlocksByStart,
volume int,
) error
// WriteSnapshot writes the data as snapshot files.
WriteSnapshot(
nsCtx ns.Context,
shards sharding.ShardSet,
data SeriesBlocksByStart,
volume int,
snapshotInterval time.Duration,
) error
// WriteDataWithPredicate writes all data that passes the predicate test as data files.
WriteDataWithPredicate(
nsCtx ns.Context,
shards sharding.ShardSet,
data SeriesBlocksByStart,
volume int,
pred WriteDatapointPredicate,
) error
// WriteSnapshotWithPredicate writes all data that passes the predicate test as snapshot files.
WriteSnapshotWithPredicate(
nsCtx ns.Context,
shards sharding.ShardSet,
data SeriesBlocksByStart,
volume int,
pred WriteDatapointPredicate,
snapshotInterval time.Duration,
) error
}
Writer writes generated data to disk.