series

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EmptySeriesID represents empty value of series.
	EmptySeriesID = uint32(math.MaxUint32)
	// IDWithoutTags represents the series ids under spec metric, but without nothing tags.
	IDWithoutTags = uint32(0)
)

Variables

View Source
var ErrFieldTypeUnspecified = errors.New("field type is unknown")
View Source
var ErrWrongFieldType = errors.New("field type is wrong")

ErrWrongFieldType is the error returned by tsdb when field-type of new point is different from the type before.

Functions

func MarshalIterator

func MarshalIterator(it Iterator) ([]byte, error)

MarshalIterator represents marshal series data of one field. format: 1byte(field type) + vint64(start time) + vint32(data length) + data

Types

type BinaryFieldIterator

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

BinaryFieldIterator implements FieldIterator interface.

func NewFieldIterator

func NewFieldIterator(data []byte) *BinaryFieldIterator

NewFieldIterator create field iterator based on binary data

func (*BinaryFieldIterator) HasNext

func (it *BinaryFieldIterator) HasNext() bool

func (*BinaryFieldIterator) MarshalBinary

func (it *BinaryFieldIterator) MarshalBinary() ([]byte, error)

func (*BinaryFieldIterator) Next

type BinaryIterator

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

BinaryIterator implements Iterator interface.

func NewIterator

func NewIterator(fieldName field.Name, data []byte) *BinaryIterator

func (*BinaryIterator) FieldName

func (b *BinaryIterator) FieldName() field.Name

func (*BinaryIterator) FieldType

func (b *BinaryIterator) FieldType() field.Type

func (*BinaryIterator) HasNext

func (b *BinaryIterator) HasNext() bool

func (*BinaryIterator) MarshalBinary

func (b *BinaryIterator) MarshalBinary() ([]byte, error)

func (*BinaryIterator) Next

func (b *BinaryIterator) Next() (startTime int64, fieldIt FieldIterator)

func (*BinaryIterator) Reset

func (b *BinaryIterator) Reset(fieldName field.Name, data []byte)

type BinaryPrimitiveIterator

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

BinaryPrimitiveIterator implements PrimitiveIterator interface.

func NewPrimitiveIterator

func NewPrimitiveIterator(aggType field.AggType, tsd *encoding.TSDDecoder) *BinaryPrimitiveIterator

func (*BinaryPrimitiveIterator) AggType

func (pi *BinaryPrimitiveIterator) AggType() field.AggType

func (*BinaryPrimitiveIterator) HasNext

func (pi *BinaryPrimitiveIterator) HasNext() bool

func (*BinaryPrimitiveIterator) Next

func (pi *BinaryPrimitiveIterator) Next() (timeSlot int, value float64)

func (*BinaryPrimitiveIterator) Reset

func (pi *BinaryPrimitiveIterator) Reset(aggType field.AggType, data []byte)

type FieldIterator

type FieldIterator interface {
	// HasNext returns if the iteration has more fields.
	HasNext() bool
	// Next returns the data point in the iteration.
	Next() PrimitiveIterator
	// BinaryMarshaler marshals the data.
	enc.BinaryMarshaler
}

FieldIterator represents a field's data iterator, support multi field for one series.

type Filter

type Filter interface {
	// GetSeriesIDsByTagValueIDs gets series ids by tag value ids for spec tag key of metric
	GetSeriesIDsByTagValueIDs(tagKeyID tag.KeyID, tagValueIDs *roaring.Bitmap) (*roaring.Bitmap, error)
	// GetSeriesIDsForTag gets series ids for spec tag key of metric
	GetSeriesIDsForTag(tagKeyID tag.KeyID) (*roaring.Bitmap, error)
	// GetSeriesIDsForMetric gets series ids for spec metric name
	GetSeriesIDsForMetric(namespace, metricName string) (*roaring.Bitmap, error)
}

Filter represents the query ability for filtering seriesIDs by expr from an index of tags.

type GroupedIterator

type GroupedIterator interface {
	// HasNext returns if the iteration has more field's iterator.
	HasNext() bool
	// Next returns the field's iterator.
	Next() Iterator
	// Tags returns group tags, tags is tag values concat string.
	Tags() string
}

GroupedIterator represents a iterator for the grouped time series data.

func NewGroupedIterator

func NewGroupedIterator(tags string, fields map[field.Name][]byte) GroupedIterator

type GroupedIterators

type GroupedIterators []GroupedIterator

type Iterator

type Iterator interface {
	// FieldName returns the field name.
	FieldName() field.Name
	// FieldType returns the field type.
	FieldType() field.Type
	// HasNext returns if the iteration has more field's iterator.
	HasNext() bool
	// Next returns the field's iterator.
	Next() (startTime int64, fieldIt FieldIterator)
	// BinaryMarshaler marshals the data.
	enc.BinaryMarshaler
}

Iterator represents an iterator for the time series data.

type MetricMetaSuggester

type MetricMetaSuggester interface {
	// SuggestMetrics returns suggestions from a given prefix of metricName
	SuggestMetrics(namespace, metricPrefix string, limit int) ([]string, error)
}

MetricMetaSuggester represents to suggest ability for metricNames and tagKeys. default max limit of suggestions is set in constants

type PrimitiveIterator

type PrimitiveIterator interface {
	// AggType returns the primitive field's agg type.
	AggType() field.AggType
	// HasNext returns if the iteration has more data points.
	HasNext() bool
	// Next returns the data point in the iteration.
	Next() (timeSlot int, value float64)
}

PrimitiveIterator represents an iterator over a primitive field, iterator points data of primitive field.

type TagValueSuggester

type TagValueSuggester interface {
	// SuggestTagValues returns suggestions from given tag key id and prefix of tagValue
	SuggestTagValues(tagKeyID tag.KeyID, tagValuePrefix string, limit int) []string
}

TagValueSuggester represents to suggest ability for tagValues. default max limit of suggestions is set in constants

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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