{"modulePath":"github.com/chronosphereiox/m3","version":"v0.0.0-20191121140916-9649366ff4b2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package executor\n\nPackage executor is a generated GoMock package.\n\n## Functions\n\n```go\nfunc CreateScalarSource(\n\tID parser.NodeID,\n\tparams ScalarParams,\n\toptions transform.Options,\n) (parser.Source, *transform.Controller)\n```\nCreateScalarSource creates a scalar source node.\n\n```go\nfunc CreateSource(\n\tID parser.NodeID,\n\tparams SourceParams, storage storage.Storage,\n\toptions transform.Options,\n) (parser.Source, *transform.Controller)\n```\nCreateSource creates a source node.\n\n```go\nfunc CreateTransform(\n\tID parser.NodeID,\n\tparams transform.Params,\n\toptions transform.Options,\n) (transform.OpNode, *transform.Controller)\n```\nCreateTransform creates a transform node which works on functions and contains state.\n\n## Types\n\n```go\ntype Engine interface {\n\t// Execute runs the query and closes the results channel once done.\n\tExecute(\n\t\tctx context.Context,\n\t\tquery *storage.FetchQuery,\n\t\topts *QueryOptions,\n\t\tfetchOpts *storage.FetchOptions,\n\t) (*storage.FetchResult, error)\n\n\t// ExecuteExpr runs the query DAG and closes the results channel once done.\n\tExecuteExpr(\n\t\tctx context.Context,\n\t\tparser parser.Parser,\n\t\topts *QueryOptions,\n\t\tfetchOpts *storage.FetchOptions,\n\t\tparams models.RequestParams,\n\t) (Result, error)\n\n\t// Options returns the currently configured options.\n\tOptions() EngineOptions\n\n\t// Close kills all running queries and prevents new queries from being attached.\n\tClose() error\n}\n```\nEngine executes a Query.\n\n```go\nfunc NewEngine(\n\tengineOpts EngineOptions,\n) Engine\n```\nNewEngine returns a new instance of QueryExecutor.\n\n```go\ntype EngineOptions interface {\n\t// InstrumentOptions returns the instrument options and scope used\n\t// for metrics.\n\tInstrumentOptions() instrument.Options\n\t// SetInstrumentOptions sets the instrument options and scope used\n\t// for metrics.\n\tSetInstrumentOptions(instrument.Options) EngineOptions\n\n\t// GlobalEnforcer returns the query cost enforcer.\n\tGlobalEnforcer() qcost.ChainedEnforcer\n\t// SetGlobalEnforcer sets the query cost enforcer.\n\tSetGlobalEnforcer(qcost.ChainedEnforcer) EngineOptions\n\n\t// Store returns the storage.\n\tStore() storage.Storage\n\t// SetStore sets the storage.\n\tSetStore(storage.Storage) EngineOptions\n\n\t// LookbackDuration returns the query lookback duration.\n\tLookbackDuration() time.Duration\n\t// SetLookbackDuration sets the query lookback duration.\n\tSetLookbackDuration(time.Duration) EngineOptions\n}\n```\nEngineOptions are used to create an engine.\n\n```go\nfunc NewEngineOptions() EngineOptions\n```\nNewEngineOptions returns a new instance of options used to create an engine.\n\n```go\ntype ExecutionState struct {\n\t// contains filtered or unexported fields\n}\n```\nExecutionState represents the execution hierarchy.\n\n```go\nfunc GenerateExecutionState(\n\tpplan plan.PhysicalPlan,\n\tstorage storage.Storage,\n\tfetchOpts *storage.FetchOptions,\n\tinstrumentOpts instrument.Options,\n) (*ExecutionState, error)\n```\nGenerateExecutionState creates an execution state from the physical plan.\n\n```go\nfunc (s *ExecutionState) Execute(queryCtx *models.QueryContext) error\n```\nExecute the sources in parallel and return the first error.\n\n```go\nfunc (s *ExecutionState) String() string\n```\nString representation of the state.\n\n```go\ntype MockEngine struct {\n\t// contains filtered or unexported fields\n}\n```\nMockEngine is a mock of Engine interface\n\n```go\nfunc NewMockEngine(ctrl *gomock.Controller) *MockEngine\n```\nNewMockEngine creates a new mock instance\n\n```go\nfunc (m *MockEngine) Close() error\n```\nClose mocks base method\n\n```go\nfunc (m *MockEngine) EXPECT() *MockEngineMockRecorder\n```\nEXPECT returns an object that allows the caller to indicate expected use\n\n```go\nfunc (m *MockEngine) Execute(arg0 context.Context, arg1 *storage.FetchQuery, arg2 *QueryOptions, arg3 *storage.FetchOptions) (*storage.FetchResult, error)\n```\nExecute mocks base method\n\n```go\nfunc (m *MockEngine) ExecuteExpr(arg0 context.Context, arg1 parser.Parser, arg2 *QueryOptions, arg3 *storage.FetchOptions, arg4 models.RequestParams) (Result, error)\n```\nExecuteExpr mocks base method\n\n```go\nfunc (m *MockEngine) Options() EngineOptions\n```\nOptions mocks base method\n\n```go\ntype MockEngineMockRecorder struct {\n\t// contains filtered or unexported fields\n}\n```\nMockEngineMockRecorder is the mock recorder for MockEngine\n\n```go\nfunc (mr *MockEngineMockRecorder) Close() *gomock.Call\n```\nClose indicates an expected call of Close\n\n```go\nfunc (mr *MockEngineMockRecorder) Execute(arg0, arg1, arg2, arg3 interface{}) *gomock.Call\n```\nExecute indicates an expected call of Execute\n\n```go\nfunc (mr *MockEngineMockRecorder) ExecuteExpr(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call\n```\nExecuteExpr indicates an expected call of ExecuteExpr\n\n```go\nfunc (mr *MockEngineMockRecorder) Options() *gomock.Call\n```\nOptions indicates an expected call of Options\n\n```go\ntype Query struct {\n\tErr    error\n\tResult Result\n}\n```\nQuery is the result after execution.\n\n```go\ntype QueryOptions struct {\n\tQueryContextOptions models.QueryContextOptions\n}\n```\nQueryOptions can be used to pass custom flags to engine.\n\n```go\ntype Request struct {\n\t// contains filtered or unexported fields\n}\n```\nRequest represents a single request.\n\n```go\ntype Result interface {\n\tResultChan() chan ResultChan\n\t// contains filtered or unexported methods\n}\n```\nResult provides the execution results\n\n```go\ntype ResultChan struct {\n\tBlock block.Block\n\tErr   error\n}\n```\nResultChan has the result from a block\n\n```go\ntype ResultNode struct {\n\t// contains filtered or unexported fields\n}\n```\nResultNode is used to provide the results to the caller from the query execution\n\n```go\nfunc (r *ResultNode) Process(queryCtx *models.QueryContext, ID parser.NodeID, block block.Block) error\n```\nProcess the block\n\n```go\nfunc (r *ResultNode) ResultChan() chan ResultChan\n```\nResultChan return a channel to stream back resultChan to the client\n\n```go\ntype ScalarParams interface {\n\tparser.Params\n\tNode(ctrl *transform.Controller, opts transform.Options) parser.Source\n}\n```\nScalarParams are defined by sources.\n\n```go\ntype SourceParams interface {\n\tparser.Params\n\tNode(ctrl *transform.Controller, storage storage.Storage,\n\t\topts transform.Options) parser.Source\n}\n```\nSourceParams are defined by sources.\n\n```go\ntype State int\n```\nState is the request state.\n\n```go\nfunc (s State) String() string\n```\n\n","path":"github.com/chronosphereiox/m3/src/query/executor","name":"executor","synopsis":"Package executor is a generated GoMock package.","isRedistributable":true}
