Documentation ¶
Index ¶
- Constants
- Variables
- func NewEngine(path string, walPath string, opt tsdb.EngineOptions) tsdb.Engine
- func WALPartition(key []byte) uint8
- type Cursor
- type Engine
- func (e *Engine) Begin(writable bool) (tsdb.Tx, error)
- func (e *Engine) Close() error
- func (e *Engine) DB() *bolt.DB
- func (e *Engine) DeleteMeasurement(name string, seriesKeys []string) error
- func (e *Engine) DeleteSeries(keys []string) error
- func (e *Engine) Flush(partitionFlushDelay time.Duration) error
- func (e *Engine) FlushPartition(partitionID uint8) error
- func (e *Engine) Format() tsdb.EngineFormat
- func (e *Engine) LoadMetadataIndex(shard *tsdb.Shard, index *tsdb.DatabaseIndex, ...) error
- func (e *Engine) Open() error
- func (e *Engine) Path() string
- func (e *Engine) PerformMaintenance()
- func (e *Engine) SeriesCount() (n int, err error)
- func (e *Engine) SetLogOutput(w io.Writer)
- func (e *Engine) WritePoints(points []models.Point, ...) error
- func (e *Engine) WriteTo(w io.Writer) (n int64, err error)
- type Tx
Constants ¶
const Format = "b1"
Format is the file format name of this engine.
const WALPartitionN = 8
WALPartitionN is the number of partitions in the write ahead log.
Variables ¶
var ( // ErrWALPartitionNotFound returns when flushing a partition that does not exist. ErrWALPartitionNotFound = errors.New("wal partition not found") )
Functions ¶
func NewEngine ¶
NewEngine returns a new instance of Engine. walPath isn't used in b1, but had to be added for later engine versions.
func WALPartition ¶
WALPartition returns the partition number that key belongs to.
Types ¶
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
Cursor provides ordered iteration across a series.
type Engine ¶
type Engine struct { // The maximum size and time thresholds for flushing the WAL. MaxWALSize int WALFlushInterval time.Duration WALPartitionFlushDelay time.Duration // The writer used by the logger. LogOutput io.Writer // contains filtered or unexported fields }
Engine represents a version 1 storage engine.
func (*Engine) DeleteMeasurement ¶
DeleteMeasurement deletes a measurement and all related series.
func (*Engine) DeleteSeries ¶
DeleteSeries deletes the series from the engine.
func (*Engine) FlushPartition ¶
FlushPartition flushes a single WAL partition.
func (*Engine) Format ¶ added in v0.9.5
func (e *Engine) Format() tsdb.EngineFormat
Format returns the format type of this engine
func (*Engine) LoadMetadataIndex ¶
func (e *Engine) LoadMetadataIndex(shard *tsdb.Shard, index *tsdb.DatabaseIndex, measurementFields map[string]*tsdb.MeasurementFields) error
LoadMetadataIndex loads the shard metadata into memory.
func (*Engine) PerformMaintenance ¶ added in v0.9.5
func (e *Engine) PerformMaintenance()
PerformMaintenance is for periodic maintenance of the store. A no-op for b1
func (*Engine) SeriesCount ¶
SeriesCount returns the number of series buckets on the shard. This does not include a count from the WAL.
func (*Engine) SetLogOutput ¶
SetLogOutput sets the writer used for log output. This must be set before opening the engine.
func (*Engine) WritePoints ¶
func (e *Engine) WritePoints(points []models.Point, measurementFieldsToSave map[string]*tsdb.MeasurementFields, seriesToCreate []*tsdb.SeriesCreate) error
WritePoints will write the raw data points and any new metadata to the index in the shard