executor

package
v0.15.17-hotfix.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: Apache-2.0 Imports: 21 Imported by: 10

Documentation

Overview

Package executor is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateScalarSource added in v0.4.1

func CreateScalarSource(
	ID parser.NodeID,
	params ScalarParams,
	options transform.Options,
) (parser.Source, *transform.Controller)

CreateScalarSource creates a scalar source node.

func CreateSource

func CreateSource(
	ID parser.NodeID,
	params SourceParams, storage storage.Storage,
	options transform.Options,
) (parser.Source, *transform.Controller)

CreateSource creates a source node.

func CreateTransform

func CreateTransform(
	ID parser.NodeID,
	params transform.Params,
	options transform.Options,
) (transform.OpNode, *transform.Controller)

CreateTransform creates a transform node which works on functions and contains state.

Types

type Engine

type Engine interface {
	// ExecuteProm runs the query and returns the result in a
	// Prometheus-compatible format (primarily used for remote read paths).
	ExecuteProm(
		ctx context.Context,
		query *storage.FetchQuery,
		opts *QueryOptions,
		fetchOpts *storage.FetchOptions,
	) (storage.PromResult, error)

	// ExecuteExpr runs the query DAG and closes the results channel once done.
	ExecuteExpr(
		ctx context.Context,
		parser parser.Parser,
		opts *QueryOptions,
		fetchOpts *storage.FetchOptions,
		params models.RequestParams,
	) (block.Block, error)

	// Options returns the currently configured options.
	Options() EngineOptions

	// Close kills all running queries and prevents new queries from being attached.
	Close() error
}

Engine executes a Query.

func NewEngine

func NewEngine(
	engineOpts EngineOptions,
) Engine

NewEngine returns a new instance of QueryExecutor.

type EngineOptions

type EngineOptions interface {
	// InstrumentOptions returns the instrument options and scope used
	// for metrics.
	InstrumentOptions() instrument.Options
	// SetInstrumentOptions sets the instrument options and scope used
	// for metrics.
	SetInstrumentOptions(instrument.Options) EngineOptions

	// GlobalEnforcer returns the query cost enforcer.
	GlobalEnforcer() qcost.ChainedEnforcer
	// SetGlobalEnforcer sets the query cost enforcer.
	SetGlobalEnforcer(qcost.ChainedEnforcer) EngineOptions

	// Store returns the storage.
	Store() storage.Storage
	// SetStore sets the storage.
	SetStore(storage.Storage) EngineOptions

	// LookbackDuration returns the query lookback duration.
	LookbackDuration() time.Duration
	// SetLookbackDuration sets the query lookback duration.
	SetLookbackDuration(time.Duration) EngineOptions

	// ParseOptions returns the parse options.
	ParseOptions() promql.ParseOptions
	// SetParseOptions sets the parse options.
	SetParseOptions(p promql.ParseOptions) EngineOptions
}

EngineOptions are used to create an engine.

func NewEngineOptions added in v0.11.0

func NewEngineOptions() EngineOptions

NewEngineOptions returns a new instance of options used to create an engine.

type ExecutionState

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

ExecutionState represents the execution hierarchy.

func GenerateExecutionState

func GenerateExecutionState(
	pplan plan.PhysicalPlan,
	storage storage.Storage,
	fetchOpts *storage.FetchOptions,
	instrumentOpts instrument.Options,
) (*ExecutionState, error)

GenerateExecutionState creates an execution state from the physical plan.

func (*ExecutionState) Execute

func (s *ExecutionState) Execute(queryCtx *models.QueryContext) error

Execute the sources in parallel and return the first error.

func (*ExecutionState) String

func (s *ExecutionState) String() string

String representation of the state.

type MockEngine added in v0.11.0

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

MockEngine is a mock of Engine interface

func NewMockEngine added in v0.11.0

func NewMockEngine(ctrl *gomock.Controller) *MockEngine

NewMockEngine creates a new mock instance

func (*MockEngine) Close added in v0.11.0

func (m *MockEngine) Close() error

Close mocks base method

func (*MockEngine) EXPECT added in v0.11.0

func (m *MockEngine) EXPECT() *MockEngineMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockEngine) ExecuteExpr added in v0.11.0

func (m *MockEngine) ExecuteExpr(arg0 context.Context, arg1 parser.Parser, arg2 *QueryOptions, arg3 *storage.FetchOptions, arg4 models.RequestParams) (block.Block, error)

ExecuteExpr mocks base method

func (*MockEngine) ExecuteProm added in v0.15.0

func (m *MockEngine) ExecuteProm(arg0 context.Context, arg1 *storage.FetchQuery, arg2 *QueryOptions, arg3 *storage.FetchOptions) (storage.PromResult, error)

ExecuteProm mocks base method

func (*MockEngine) Options added in v0.11.0

func (m *MockEngine) Options() EngineOptions

Options mocks base method

type MockEngineMockRecorder added in v0.11.0

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

MockEngineMockRecorder is the mock recorder for MockEngine

func (*MockEngineMockRecorder) Close added in v0.11.0

func (mr *MockEngineMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close

func (*MockEngineMockRecorder) ExecuteExpr added in v0.11.0

func (mr *MockEngineMockRecorder) ExecuteExpr(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call

ExecuteExpr indicates an expected call of ExecuteExpr

func (*MockEngineMockRecorder) ExecuteProm added in v0.15.0

func (mr *MockEngineMockRecorder) ExecuteProm(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

ExecuteProm indicates an expected call of ExecuteProm

func (*MockEngineMockRecorder) Options added in v0.11.0

func (mr *MockEngineMockRecorder) Options() *gomock.Call

Options indicates an expected call of Options

type QueryOptions added in v0.10.0

type QueryOptions struct {
	QueryContextOptions models.QueryContextOptions
}

QueryOptions can be used to pass custom flags to engine.

type Request added in v0.4.8

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

Request represents a single request.

type ScalarParams added in v0.4.1

type ScalarParams interface {
	parser.Params
	Node(ctrl *transform.Controller, opts transform.Options) parser.Source
}

ScalarParams are defined by sources.

type SourceParams

type SourceParams interface {
	parser.Params
	Node(ctrl *transform.Controller, storage storage.Storage,
		opts transform.Options) parser.Source
}

SourceParams are defined by sources.

type State added in v0.4.8

type State int

State is the request state.

func (State) String added in v0.4.8

func (s State) String() string

Directories

Path Synopsis
Package transform is a generated GoMock package.
Package transform is a generated GoMock package.

Jump to

Keyboard shortcuts

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