Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MetricDataMerger kv.MergerType = "MetricDataMerger"
Functions ¶
Types ¶
type FieldReader ¶
type FieldReader interface { // SlotRange returns the time slot range of metric level SlotRange() timeutil.SlotRange // GetFieldData returns the field data by field id, // if metricReader is completed, return nil, if found data returns field data else returns nil GetFieldData(fieldID field.ID) []byte // Reset resets the field data for reading Reset(seriesEntry []byte, slotRange timeutil.SlotRange) // Close closes the metricReader Close() }
FieldReader represents the field metricReader when does metric data merge. !!!!NOTICE: need get field value in order by field
type Filter ¶
type Filter interface { // Filter filters data under each sst file based on query condition Filter(seriesIDs *roaring.Bitmap, fields field.Metas) ([]flow.FilterResultSet, error) }
Filter implements filtering metrics from sst files.
type Flusher ¶
type Flusher interface { // PrepareMetric prepares to write a new metric block PrepareMetric( metricID uint32, fieldMetas field.Metas, ) // FlushField writes a compressed field data to writer. // It will be called in order with field metas even if field data is empty FlushField(data []byte) error // FlushSeries writes a full series, this will be called after writing all fields of this entry. FlushSeries(seriesID uint32) error // CommitMetric ends writing a full metric block // this will be called after writing all entries of this metric. CommitMetric(slotRange timeutil.SlotRange) error // GetFieldMetas returns current field metas of metric. GetFieldMetas() field.Metas // GetEncoder returns tsd encoder by field index. GetEncoder(fieldIdx int) *encoding.TSDEncoder // Closer closes the writer, syncs all data to the file. io.Closer }
Flusher is a wrapper of kv.Builder, provides ability to flush a metric-table file to disk. The layout is available in `tsdb/doc.go` Level1: metric-block Level2: series entry Level3: compressed field data
flush step: 1. flush field metas of metric level 2. flush field store of one series 3. flush series id 4. flush metric data include field metadata and all series ids data
type MetricReader ¶
type MetricReader interface { // Path returns file path Path() string // GetSeriesIDs returns the series ids in this sst file GetSeriesIDs() *roaring.Bitmap // GetFields returns the field metas in this sst file GetFields() field.Metas // GetTimeRange returns the time range in this sst file GetTimeRange() timeutil.SlotRange // Load loads the data from sst file, then returns the file metric scanner. Load(ctx *flow.DataLoadContext) flow.DataLoader // contains filtered or unexported methods }
MetricReader represents the metric block metricReader
type SeriesMerger ¶
type SeriesMerger interface {
// contains filtered or unexported methods
}
SeriesMerger represents series data merger which merge multi fields under same series id