processor

package
v0.76.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 23 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IndexFetch

func IndexFetch(ids []seq.ID, noSkipMasks bool, sw *stopwatch.Stopwatch, fetchIndex fetchIndex, res [][]byte) error

func IndexSearch

func IndexSearch(
	ctx context.Context,
	params SearchParams,
	index searchIndex,
	aggLimits AggLimits,
	sw *stopwatch.Stopwatch,
) (qpr *seq.QPR, err error)

func MergeQPRs

func MergeQPRs(qprs []*seq.QPR, params SearchParams) *seq.QPR

Types

type AggBin

type AggBin[T comparable] struct {
	MID    seq.MID
	Source T
}

AggBin is a container for documents which were written in the same time interval. When dealing with aggregation (without need in building time series) AggBin.MID is equal to [DummyMID].

type AggLimits

type AggLimits struct {
	// MaxFieldTokens max AggQuery.Field uniq values to parse.
	MaxFieldTokens int
	// MaxFieldValues max AggQuery.Field uniq values to hold in memory
	MaxFieldValues int
	// MaxGroupTokens max AggQuery.GroupBy unique values.
	MaxGroupTokens int
	// MaxTIDsPerFraction max number of tokens per fraction.
	MaxTIDsPerFraction int
}

type AggQuery

type AggQuery struct {
	Field     *parser.Literal
	GroupBy   *parser.Literal
	Func      seq.AggFunc
	Quantiles []float64
	Interval  int64
}

func (AggQuery) MarshalLogObject added in v0.69.0

func (q AggQuery) MarshalLogObject(enc zapcore.ObjectEncoder) error

type Aggregator

type Aggregator interface {
	// Next iterates to count the next lid.
	Next(lid node.LID) error
	// Aggregate processes and returns the final aggregation result.
	Aggregate() (seq.AggregatableSamples, error)
}

type ExtractMIDFunc

type ExtractMIDFunc func(seq.LID) seq.MID

ExtractMIDFunc is necessary since in aggregators we do not have [idsIndex] interface, we need a way to extract timestamp of document to build time series.

type HistMap added in v0.72.0

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

HistMap is an optimized array-based map for histogram.

func NewHistMap added in v0.72.0

func NewHistMap(from, to seq.MID, intervalMillis uint64) HistMap

func (HistMap) ToMap added in v0.72.0

func (h HistMap) ToMap() map[seq.MID]uint64

func (*HistMap) Update added in v0.72.0

func (h *HistMap) Update(mids []seq.MID)

type SearchParams

type SearchParams struct {
	AST *parser.ASTNode `json:"-"`

	AggQ         []AggQuery
	HistInterval uint64

	From     seq.MID
	To       seq.MID
	OffsetId seq.ID
	Limit    int

	WithTotal bool
	Order     seq.DocsOrder

	Downsample uint32
}

func (*SearchParams) HasAgg

func (p *SearchParams) HasAgg() bool

func (*SearchParams) HasHist

func (p *SearchParams) HasHist() bool

func (*SearchParams) IsScanAllRequest

func (p *SearchParams) IsScanAllRequest() bool

func (SearchParams) MarshalLogObject added in v0.69.0

func (p SearchParams) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*SearchParams) Type added in v0.69.0

func (p *SearchParams) Type() string

type SingleSourceCountAggregator

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

SingleSourceCountAggregator aggregates counts for a single source.

func NewSingleSourceCountAggregator

func NewSingleSourceCountAggregator(
	iterator *SourcedNodeIterator, fn ExtractMIDFunc,
) *SingleSourceCountAggregator

func (*SingleSourceCountAggregator) Aggregate

func (*SingleSourceCountAggregator) Next

Next iterates over groupBy tree to count occurrence.

type SingleSourceHistogramAggregator

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

func NewSingleSourceHistogramAggregator

func NewSingleSourceHistogramAggregator(
	field *SourcedNodeIterator, collectSamples bool, fn ExtractMIDFunc,
) *SingleSourceHistogramAggregator

func (*SingleSourceHistogramAggregator) Aggregate

func (*SingleSourceHistogramAggregator) Next

type SingleSourceUniqueAggregator

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

SingleSourceUniqueAggregator aggregates unique values for a single source.

func NewSingleSourceUniqueAggregator

func NewSingleSourceUniqueAggregator(iterator *SourcedNodeIterator) *SingleSourceUniqueAggregator

func (*SingleSourceUniqueAggregator) Aggregate

func (*SingleSourceUniqueAggregator) Next

Next iterates over groupBy tree to count occurrence.

type SourcedNodeIterator

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

SourcedNodeIterator can iterate the sourced node that returns source, which means index in a tids slice.

func NewSourcedNodeIterator

func NewSourcedNodeIterator(sourced node.Sourced, ti tokenIndex, tids []uint32, field string, limit iteratorLimit) *SourcedNodeIterator

func (*SourcedNodeIterator) ConsumeTokenSource

func (s *SourcedNodeIterator) ConsumeTokenSource(lid node.LID) (uint32, bool, error)

func (*SourcedNodeIterator) UniqueSources

func (s *SourcedNodeIterator) UniqueSources() int

func (*SourcedNodeIterator) ValueBySource

func (s *SourcedNodeIterator) ValueBySource(source uint32) string

type TwoSourceAggregator

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

TwoSourceAggregator implements Aggregator interface and can iterate over groupBy and field node.Sourced to collect a histogram.

func NewGroupAndFieldAggregator

func NewGroupAndFieldAggregator(
	fieldIterator, groupByIterator *SourcedNodeIterator,
	fn ExtractMIDFunc, collectSamples bool, collectValues bool,
	limits AggLimits,
) *TwoSourceAggregator

func (*TwoSourceAggregator) Aggregate

Aggregate processes and returns the final aggregation result.

func (*TwoSourceAggregator) Next

func (n *TwoSourceAggregator) Next(lid node.LID) error

Next iterates over groupBy and field iterators (actually trees) to count occurrence.

Jump to

Keyboard shortcuts

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