query

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecutionPlan

type ExecutionPlan struct {
	Segments       []index.SegmentTimeRange
	Steps          []PlanStep
	TotalSegments  int
	PrunedSegments int
}

func (*ExecutionPlan) HasStep

func (plan *ExecutionPlan) HasStep(step PlanStep) bool

type Executor

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

func NewExecutor

func NewExecutor(
	logManager *storage.SegmentManager,
	spanManager *storage.SegmentManager,
	logSparse *index.SparseIndex,
	spanSparse *index.SparseIndex,
) *Executor

func NewExecutorWithCache

func NewExecutorWithCache(
	logManager *storage.SegmentManager,
	spanManager *storage.SegmentManager,
	logSparse *index.SparseIndex,
	spanSparse *index.SparseIndex,
	logDir, spanDir string,
	cacheSize int,
) *Executor

func (*Executor) Close

func (e *Executor) Close()

func (*Executor) ExecLog

func (e *Executor) ExecLog(ctx context.Context, q *LogQuery) (*LogResult, error)

func (*Executor) ExecSpan

func (e *Executor) ExecSpan(ctx context.Context, q *SpanQuery) (*SpanResult, error)

func (*Executor) IndexLogEntries

func (e *Executor) IndexLogEntries(entries []*model.LogEntry)

func (*Executor) IndexLogEntry

func (e *Executor) IndexLogEntry(entry model.LogEntry)

func (*Executor) IndexSpanEntries

func (e *Executor) IndexSpanEntries(spans []*model.SpanEntry)

func (*Executor) IndexSpanEntry

func (e *Executor) IndexSpanEntry(span model.SpanEntry)

func (*Executor) InvalidateLogSegment

func (e *Executor) InvalidateLogSegment(seg storage.SegmentMeta)

func (*Executor) InvalidateSpanSegment

func (e *Executor) InvalidateSpanSegment(seg storage.SegmentMeta)

func (*Executor) RegisterBitmapIndex

func (e *Executor) RegisterBitmapIndex(segmentFile string, idx *index.MultiFieldIndex)

func (*Executor) RegisterFTSIndex

func (e *Executor) RegisterFTSIndex(segmentFile string, idx *index.FTSIndex)

func (*Executor) RegisterLogFTSRibbon

func (e *Executor) RegisterLogFTSRibbon(segmentFile string, f *index.RibbonFilter)

func (*Executor) RegisterLogRibbon

func (e *Executor) RegisterLogRibbon(segmentFile string, f *index.RibbonFilter)

func (*Executor) RegisterSpanBitmapIndex

func (e *Executor) RegisterSpanBitmapIndex(segmentFile string, idx *index.MultiFieldIndex)

func (*Executor) RegisterSpanRibbon

func (e *Executor) RegisterSpanRibbon(segmentFile string, f *index.RibbonFilter)

func (*Executor) Services

func (e *Executor) Services() []string

type LogQuery

type LogQuery struct {
	From     time.Time
	To       time.Time
	Services []string
	Hosts    []string
	Levels   []string
	Attrs    map[string]string
	FullText string
	TraceID  model.TraceID
	Limit    int
	Offset   int
}

func (*LogQuery) FromUnixNano

func (q *LogQuery) FromUnixNano() int64

func (*LogQuery) HasFieldFilters

func (q *LogQuery) HasFieldFilters() bool

func (*LogQuery) HasFullText

func (q *LogQuery) HasFullText() bool

func (*LogQuery) HasTimeRange

func (q *LogQuery) HasTimeRange() bool

func (*LogQuery) ToUnixNano

func (q *LogQuery) ToUnixNano() int64

func (*LogQuery) Validate

func (q *LogQuery) Validate() error

type LogResult

type LogResult struct {
	Entries   []model.LogEntry
	TotalHits int
	Truncated bool

	SegTotal   int  `json:"seg_total,omitempty"`
	SegScanned int  `json:"seg_scanned,omitempty"`
	CacheHit   bool `json:"cache_hit,omitempty"`
}

type PlanStep

type PlanStep uint8
const (
	StepSegmentPruning PlanStep = iota
	StepBitmapFilter
	StepFTSSearch
	StepFetchRecords
	StepPostFilter
	StepPaginate
)

func (PlanStep) String

func (s PlanStep) String() string

type Planner

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

func NewPlanner

func NewPlanner(sparse *index.SparseIndex) *Planner

func (*Planner) Plan

func (p *Planner) Plan(q *LogQuery) *ExecutionPlan

type SpanQuery

type SpanQuery struct {
	From        time.Time
	To          time.Time
	Services    []string
	Operations  []string
	TraceID     model.TraceID
	MinDuration time.Duration
	MaxDuration time.Duration
	Statuses    []model.SpanStatus
	Limit       int
	Offset      int
}

func (*SpanQuery) Validate

func (q *SpanQuery) Validate() error

type SpanResult

type SpanResult struct {
	Spans     []model.SpanEntry
	TotalHits int
	Truncated bool
}

Jump to

Keyboard shortcuts

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