model

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package model defines the structures and interfaces for query options and results.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Name   string
	Values []*modelv1.FieldValue
}

Field is a field name and its values.

type MeasureQueryOptions

type MeasureQueryOptions struct {
	Query           index.Query
	TimeRange       *timestamp.TimeRange
	Order           *index.OrderBy
	Name            string
	Entities        [][]*modelv1.TagValue
	TagProjection   []TagProjection
	FieldProjection []string
}

MeasureQueryOptions is the options of a measure query.

type MeasureQueryResult

type MeasureQueryResult interface {
	Pull() *MeasureResult
	Release()
}

MeasureQueryResult is the result of a measure query.

type MeasureResult

type MeasureResult struct {
	Error       error
	Timestamps  []int64
	Versions    []int64
	TagFamilies []TagFamily
	Fields      []Field
	SID         common.SeriesID
}

MeasureResult is the result of a query.

type StreamQueryOptions

type StreamQueryOptions struct {
	Name           string
	TimeRange      *timestamp.TimeRange
	Entities       [][]*modelv1.TagValue
	InvertedFilter index.Filter
	SkippingFilter index.Filter
	Order          *index.OrderBy
	TagProjection  []TagProjection
	MaxElementSize int
}

StreamQueryOptions is the options of a stream query.

func (*StreamQueryOptions) CopyFrom added in v0.8.0

func (s *StreamQueryOptions) CopyFrom(other *StreamQueryOptions)

CopyFrom copies the StreamQueryOptions from other to s.

func (*StreamQueryOptions) Reset added in v0.8.0

func (s *StreamQueryOptions) Reset()

Reset resets the StreamQueryOptions.

type StreamQueryResult

type StreamQueryResult interface {
	Pull(context.Context) *StreamResult
	Release()
}

StreamQueryResult is the result of a stream query.

type StreamResult

type StreamResult struct {
	Error       error
	Timestamps  []int64
	ElementIDs  []uint64
	TagFamilies []TagFamily
	SIDs        []common.SeriesID
	// contains filtered or unexported fields
}

StreamResult is the result of a query.

func MergeStreamResults added in v0.8.0

func MergeStreamResults(results []*StreamResult, topN int, asc bool) *StreamResult

MergeStreamResults merges multiple StreamResult slices into a single StreamResult.

func NewStreamResult added in v0.8.0

func NewStreamResult(topN int, asc bool) *StreamResult

NewStreamResult creates a new StreamResult.

func (*StreamResult) CopyFrom added in v0.8.0

func (sr *StreamResult) CopyFrom(tmp, other *StreamResult) bool

CopyFrom copies the topN results from other to sr using tmp as a temporary result.

func (*StreamResult) CopySingleFrom added in v0.8.0

func (sr *StreamResult) CopySingleFrom(other *StreamResult)

CopySingleFrom copies a single result from other to sr.

func (*StreamResult) Len added in v0.8.0

func (sr *StreamResult) Len() int

Len returns the length of the StreamResult.

func (*StreamResult) Reset added in v0.8.0

func (sr *StreamResult) Reset()

Reset resets the StreamResult.

type StreamResultHeap added in v0.8.0

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

StreamResultHeap is a min-heap of StreamResult pointers.

func (StreamResultHeap) Len added in v0.8.0

func (h StreamResultHeap) Len() int

func (StreamResultHeap) Less added in v0.8.0

func (h StreamResultHeap) Less(i, j int) bool

func (*StreamResultHeap) Pop added in v0.8.0

func (h *StreamResultHeap) Pop() interface{}

Pop pops a StreamResult pointer from the heap.

func (*StreamResultHeap) Push added in v0.8.0

func (h *StreamResultHeap) Push(x interface{})

Push pushes a StreamResult pointer to the heap.

func (StreamResultHeap) Swap added in v0.8.0

func (h StreamResultHeap) Swap(i, j int)

type Tag

type Tag struct {
	Name   string
	Values []*modelv1.TagValue
}

Tag is a tag name and its values.

type TagFamily

type TagFamily struct {
	Name string
	Tags []Tag
}

TagFamily is a tag family name and its tags.

type TagFilterMatcher added in v0.9.0

type TagFilterMatcher interface {
	// Match returns true if the given tags match the filter criteria.
	// tags is a slice of tags for a single element/row.
	Match(tags []*modelv1.Tag) (bool, error)
	// GetDecoder returns the decoder function for tag values.
	GetDecoder() TagValueDecoder
}

TagFilterMatcher is a simple interface for matching tags without schema dependency. This avoids cycle imports between logical and sidx packages.

type TagProjection

type TagProjection struct {
	Family string
	Names  []string
}

TagProjection is the projection of a tag family and its tags.

type TagValueDecoder added in v0.9.0

type TagValueDecoder func(valueType pbv1.ValueType, value []byte, valueArr [][]byte) *modelv1.TagValue

TagValueDecoder decodes a byte slice to a TagValue based on the value type.

type TagValueDecoderProvider added in v0.9.0

type TagValueDecoderProvider interface {
	GetTagValueDecoder() TagValueDecoder
}

TagValueDecoderProvider provides a decoder for tag values.

type TraceQueryOptions added in v0.9.0

type TraceQueryOptions struct {
	SkippingFilter index.Filter
	TagFilter      TagFilterMatcher
	TimeRange      *timestamp.TimeRange
	Order          *index.OrderBy
	TagProjection  *TagProjection
	Name           string
	Entities       [][]*modelv1.TagValue
	TraceIDs       []string
	MaxTraceSize   int
	MinVal         int64
	MaxVal         int64
}

TraceQueryOptions is the options of a trace query.

func (*TraceQueryOptions) CopyFrom added in v0.9.0

func (t *TraceQueryOptions) CopyFrom(other *TraceQueryOptions)

CopyFrom copies the TraceQueryOptions from other to t.

func (*TraceQueryOptions) Reset added in v0.9.0

func (t *TraceQueryOptions) Reset()

Reset resets the TraceQueryOptions.

type TraceQueryResult added in v0.9.0

type TraceQueryResult interface {
	Pull() *TraceResult
	Release()
}

TraceQueryResult is the result of a trace query.

type TraceResult added in v0.9.0

type TraceResult struct {
	Error      error
	TID        string
	Spans      [][]byte
	SpanIDs    []string
	Tags       []Tag
	Key        int64
	GroupIndex int
}

TraceResult is the result of a query.

Jump to

Keyboard shortcuts

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