Documentation
¶
Overview ¶
Package executor defines the specifications accessing underlying data repositories.
Index ¶
- func WithDistributedExecutionContext(ctx context.Context, ec DistributedExecutionContext) context.Context
- type BatchIterator
- type DistributedExecutionContext
- type DistributedExecutionContextKey
- type MIterator
- type MeasureExecutable
- type MeasureExecutionContext
- type StreamCloser
- type StreamExecutable
- type StreamExecutionContext
- type StreamVecExecutable
- type StreamVecScanSource
- type TraceExecutable
- type TraceExecutionContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithDistributedExecutionContext ¶ added in v0.5.0
func WithDistributedExecutionContext(ctx context.Context, ec DistributedExecutionContext) context.Context
WithDistributedExecutionContext returns a new context with distributed execution context.
Types ¶
type BatchIterator ¶ added in v0.12.0
type BatchIterator interface {
// NextBatch returns the next batch with at least one active row, or nil at the end.
// A returned batch stays valid after later calls and after Close.
NextBatch(ctx context.Context) (*vectorized.RecordBatch, error)
// Close releases the pipeline and the scan source. It is safe to call more than once.
Close() error
}
BatchIterator yields the output batches of a vectorized plan one at a time.
type DistributedExecutionContext ¶ added in v0.5.0
type DistributedExecutionContext interface {
bus.Broadcaster
bus.Scatterer
TimeRange() *modelv1.TimeRange
NodeSelectors() map[string][]string
}
DistributedExecutionContext allows retrieving data through the distributed module.
func FromDistributedExecutionContext ¶ added in v0.5.0
func FromDistributedExecutionContext(ctx context.Context) DistributedExecutionContext
FromDistributedExecutionContext returns the distributed execution context from context.Context.
type DistributedExecutionContextKey ¶ added in v0.5.0
type DistributedExecutionContextKey struct{}
DistributedExecutionContextKey is the key of distributed execution context in context.Context.
type MIterator ¶
type MIterator interface {
Next() bool
Current() []*measurev1.InternalDataPoint
Close() error
}
MIterator allows iterating in a measure data set.
type MeasureExecutable ¶
MeasureExecutable allows querying in the measure schema.
type MeasureExecutionContext ¶
type MeasureExecutionContext interface {
Query(ctx context.Context, opts model.MeasureQueryOptions) (model.MeasureQueryResult, error)
}
MeasureExecutionContext allows retrieving data through the measure module.
type StreamCloser ¶ added in v0.12.0
type StreamCloser interface {
Close()
}
StreamCloser releases the resources a stream plan node holds. It is separate from StreamExecutable so a plan tree can be released without asserting the row Execute capability.
type StreamExecutable ¶
type StreamExecutable interface {
Execute(context.Context) ([]*streamv1.Element, error)
StreamCloser
}
StreamExecutable allows querying in the stream schema.
type StreamExecutionContext ¶
type StreamExecutionContext interface {
QueryVectorized(ctx context.Context, opts model.StreamQueryOptions) (StreamVecScanSource, error)
VectorizedConfig() vstream.VectorizedConfig
}
StreamExecutionContext allows retrieving data through the stream module.
QueryVectorized and VectorizedConfig are the vec-path additions: the former yields a pull-based columnar scan source (the M3 vecScanSource), the latter surfaces the engine-side --stream-vectorized-* configuration so the vec dispatch can decide whether the flag is on.
type StreamVecExecutable ¶ added in v0.11.0
type StreamVecExecutable interface {
ExecuteVectorized(ctx context.Context) ([]*vectorized.RecordBatch, *vectorized.BatchSchema, error)
// OpenVectorized starts the same execution as ExecuteVectorized and returns the
// merged, deduplicated and limited batches one at a time, so a caller can send
// each before the next is produced. The merge is still a breaker: it consumes
// its whole input before the first batch is returned. The returned schema is nil
// when the scan found no source, and the iterator is then empty. The caller must
// Close the iterator, which releases the pipeline and the scan source.
OpenVectorized(ctx context.Context) (BatchIterator, *vectorized.BatchSchema, error)
// ProjectionTags returns the projected tag families/names in projection order,
// so the egress builds the same tag families/tags the row path would.
ProjectionTags() []model.TagProjection
// HiddenOrderTag returns the ordered tag the scan requests but ProjectionTags()
// omits, or "" when the client projection already carries it. The columnar frame
// egress rebuilds the projection from the batch schema, so it drops that column
// by name; a bool cannot carry the name, and the egress has no other way to
// learn it.
HiddenOrderTag() string
}
StreamVecExecutable is the capability a stream plan node exposes when it can be executed through the native columnar (vectorized) path. The data-node processor type-asserts the analyzed plan to this interface; since the row path was removed in 0.12.0 a failed assertion is a hard error, not a fallback.
ExecuteVectorized returns the fully merged/deduped/limited columnar batches (the M4 pipeline already applied) plus the batch schema, so both the standalone egress and the data-node frame emit consume a single columnar result.
type StreamVecScanSource ¶ added in v0.11.0
type StreamVecScanSource interface {
NextBatch(ctx context.Context) (*vectorized.RecordBatch, error)
// Schema returns the batch schema the source stamps on every batch it emits.
// The M4 SortedMerge validates batch.Schema by pointer identity, so the merge
// pipeline MUST be built with this exact schema, not a freshly-built one.
Schema() *vectorized.BatchSchema
Release()
}
StreamVecScanSource is the pull contract the vec scan source exposes: one columnar batch per NextBatch, (nil, nil) at exhaustion, Release to free resources. It mirrors banyand/stream's vecScanSource without importing it, so the executor package stays free of a data-node dependency cycle.
type TraceExecutable ¶ added in v0.9.0
type TraceExecutable interface {
Execute(context.Context) (iter.Iterator[model.TraceResult], error)
Close()
}
TraceExecutable allows querying in the trace schema.
type TraceExecutionContext ¶ added in v0.9.0
type TraceExecutionContext interface {
Query(ctx context.Context, opts model.TraceQueryOptions) (model.TraceQueryResult, error)
}
TraceExecutionContext allows retrieving data through the trace module.