executor

package
v0.0.0-...-22d5a31 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DistributionFactorFn

type DistributionFactorFn func(namespace string, domain string, seriesFamily string) uint16

Callback function type that return the distribution factor for a series

type ExecutablePlanNode

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

func NewFetchFamilyPlanNode

func NewFetchFamilyPlanNode(
	name string,
	domain string,
	familyName string) *ExecutablePlanNode

func NewFetchSeriesPlanNode

func NewFetchSeriesPlanNode(
	name string,
	domain string,
	familyName string) *ExecutablePlanNode

func NewSelectPlanNode

func NewSelectPlanNode(
	name string,
	source string,
	fieldName string) *ExecutablePlanNode

Create a new selection field plan node with column name expression

func (*ExecutablePlanNode) ExpressionArgs

func (planNode *ExecutablePlanNode) ExpressionArgs() interface{}

Return the where expression args

func (*ExecutablePlanNode) ExpressionState

func (planNode *ExecutablePlanNode) ExpressionState() base.ExpressionState

Return the where expression state

type ExecutionPendingNode

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

type Executor

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

func NewExecutor

func NewExecutor(
	namespace string,
	defaultDomain string,
	distributionFactorFn DistributionFactorFn,
	queryPlan *QueryPlan,
	boostSession *client.BoostSession,
	startTime xtime.UnixNano,
	endTime xtime.UnixNano,
	executionWindowSize time.Duration,
	batchSize int) *Executor

func (*Executor) Execute

func (e *Executor) Execute() (error, bool)

Execute the query plan associated with the executor. Returns an error and a boolean indicating whether there are results from the execution. Batch size is used to optimize the initial allocation size of many internal structure. executionWindowSize determines how many times this function will needs to be called until complete results are returned. After each Execute call, the results are available in the ResultSet. The columns information is available in the Fields.

func (*Executor) Fields

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

Return the fields associated with the result set. The fields are the columns of the result set. The fields are valid only until the next call to Execute.

func (*Executor) ResultSet

func (e *Executor) ResultSet() (*base.ResultSet, error)

Return the result set from the most recent Execute call. Note that the result set is valid only until the next call to Execute.

type PlanIterator

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

func NewPlanIterator

func NewPlanIterator(queryPlan *QueryPlan) *PlanIterator

Create a new plan iterator

func (*PlanIterator) Done

func (pi *PlanIterator) Done() bool

Return true if the iterator is done, otherwise returns false

func (*PlanIterator) Next

func (pi *PlanIterator) Next() (bool, error)

Get the next plan nodes

func (*PlanIterator) PlanNodes

func (pi *PlanIterator) PlanNodes() []*ExecutablePlanNode

Return the nodes at the current depth

type PlanNodeType

type PlanNodeType int

ExecutablePlanNode Type

const (
	// Fetch Series Family Operation
	PlanNodeTypeFetchFamily PlanNodeType = iota

	// Fetch the Series Operation
	PlanNodeTypeFetchSeries

	// Select Series Operation
	PlanNodeTypeSelectSeries

	// Where Operation
	PlanNodeTypeWhere
)

type Planner

type Planner struct {
}

A planner to generate an execution plan that specifies the steps to be performed to generate the result set.

func NewPlanner

func NewPlanner() *Planner

Create a new planner

func (*Planner) GeneratePlan

func (p *Planner) GeneratePlan(queryOps *base.QueryOps) *QueryPlan

Generate a query plan

type QueryPlan

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

func (*QueryPlan) AdjacentNodes

func (qp *QueryPlan) AdjacentNodes(nodes []*ExecutablePlanNode) ([]*ExecutablePlanNode, error)

Return the nodes that are adjacent to the specified nodes

func (*QueryPlan) Iterator

func (qp *QueryPlan) Iterator() *PlanIterator

Return an iterator for the query plan

func (*QueryPlan) NodesAtDepth

func (qp *QueryPlan) NodesAtDepth(depth int) []*ExecutablePlanNode

Return the nodes in the query plan at the specified depth

func (*QueryPlan) NodesAtOrBelowDepth

func (qp *QueryPlan) NodesAtOrBelowDepth(depthLimit int) []*ExecutablePlanNode

Return the nodes in the query plan with depths less than the specified depth

func (*QueryPlan) Parents

func (qp *QueryPlan) Parents(node *ExecutablePlanNode) ([]*ExecutablePlanNode, error)

Return the nodes that are parents of the specified node

type SelectFieldInfo

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

type SeriesIteratorInfo

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

type SourceFetchOp

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

Jump to

Keyboard shortcuts

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