vm

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CancelResult = CallResult{
	Status: ExecStop,
}

Functions

func CancelCheck added in v1.1.0

func CancelCheck(proc *process.Process) (error, bool)

func Prepare

func Prepare(ins Instructions, proc *process.Process) error

Prepare range instructions and do init work for each operator's argument by calling its prepare function

func Run

func Run(ins Instructions, proc *process.Process) (end bool, err error)

func String

func String(ins Instructions, buf *bytes.Buffer)

String range instructions and call each operator's string function to show a query plan

Types

type CallResult added in v1.1.0

type CallResult struct {
	Status ExecStatus
	Batch  *batch.Batch
}

func ChildrenCall added in v1.1.0

func ChildrenCall(o Operator, proc *process.Process, anal process.Analyze) (CallResult, error)

func NewCallResult added in v1.1.0

func NewCallResult() CallResult

type CtrState added in v1.1.0

type CtrState int
const (
	Build CtrState = iota
	Eval
	End
)

type ExecStatus added in v1.1.0

type ExecStatus int
const (
	ExecStop ExecStatus = iota
	ExecNext
	ExecHasMore
)

type Instruction

type Instruction struct {
	// Op specified the operator code of an instruction.
	Op OpType
	// Idx specified the analysis information index.
	Idx int
	// Arg contains the operand of this instruction.
	Arg Operator

	// flag for analyzeInfo record the row information
	IsFirst bool
	IsLast  bool

	CnAddr      string
	OperatorID  int32
	ParallelID  int32
	MaxParallel int32
}

Instruction contains relational algebra

func (*Instruction) CannotRemote added in v1.0.1

func (ins *Instruction) CannotRemote() bool

func (*Instruction) IsBrokenNode added in v0.6.0

func (ins *Instruction) IsBrokenNode() bool

func (*Instruction) MarshalBinary added in v0.6.0

func (ins *Instruction) MarshalBinary() ([]byte, error)

func (*Instruction) UnmarshalBinary added in v0.6.0

func (ins *Instruction) UnmarshalBinary(_ []byte) error

type Instructions

type Instructions []Instruction

type ModificationArgument added in v0.8.0

type ModificationArgument interface {
	AffectedRows() uint64
}

type OpType added in v0.8.0

type OpType int
const (
	Top OpType = iota
	Limit
	Order
	Group
	Window
	TimeWin
	Fill
	Output
	Offset
	Product
	Restrict
	Dispatch
	Connector
	Projection

	Join
	LoopJoin
	Left
	LoopLeft
	Single
	LoopSingle
	Semi
	RightSemi
	LoopSemi
	Anti
	RightAnti
	LoopAnti
	Mark
	LoopMark
	IndexJoin
	IndexBuild

	Merge
	MergeTop
	MergeLimit
	MergeOrder
	MergeGroup
	MergeOffset
	MergeRecursive
	MergeCTE
	Partition

	Deletion
	Insert
	External
	Source

	Minus
	Intersect
	IntersectAll

	HashBuild

	TableFunction
	TableScan
	ValueScan
	// MergeBlock is used to recieve S3 block metLoc Info, and write
	// them to S3
	MergeBlock
	// MergeDelete is used to recieve S3 Blcok Delete Info from remote Cn
	MergeDelete
	Right
	OnDuplicateKey
	FuzzyFilter
	PreInsert
	PreInsertUnique
	PreInsertSecondaryIndex
	// LastInstructionOp is not a true operator and must set at last.
	// It was used by unit testing to ensure that
	// all functions related to instructions can reach 100% coverage.
	LastInstructionOp

	// LockOp is used to add locks to lockservice for pessimistic transactions.
	// Operator that encounters a write conflict will block until the previous
	// transaction has released the lock
	LockOp

	Shuffle

	Sample
)

type Operator added in v1.1.0

type Operator interface {
	// Free release all the memory allocated from mPool in an operator.
	// pipelineFailed marks the process status of the pipeline when the method is called.
	Free(proc *process.Process, pipelineFailed bool, err error)

	// String returns the string representation of an operator.
	String(buf *bytes.Buffer)

	//Prepare prepares an operator for execution.
	Prepare(proc *process.Process) error

	//Call calls an operator.
	Call(proc *process.Process) (CallResult, error)

	//Release an operator
	Release()

	// OperatorBase methods
	SetInfo(info *OperatorInfo)
	AppendChild(child Operator)

	GetOperatorBase() *OperatorBase
}

type OperatorBase added in v1.2.0

type OperatorBase struct {
	OperatorInfo
	Children []Operator
}

func (*OperatorBase) AppendChild added in v1.2.0

func (o *OperatorBase) AppendChild(child Operator)

func (*OperatorBase) GetChildren added in v1.2.0

func (o *OperatorBase) GetChildren(idx int) Operator

func (*OperatorBase) GetCnAddr added in v1.2.0

func (o *OperatorBase) GetCnAddr() string

func (*OperatorBase) GetIdx added in v1.2.0

func (o *OperatorBase) GetIdx() int

func (*OperatorBase) GetIsFirst added in v1.2.0

func (o *OperatorBase) GetIsFirst() bool

func (*OperatorBase) GetIsLast added in v1.2.0

func (o *OperatorBase) GetIsLast() bool

func (*OperatorBase) GetMaxParallel added in v1.2.0

func (o *OperatorBase) GetMaxParallel() int32

func (*OperatorBase) GetOperatorID added in v1.2.0

func (o *OperatorBase) GetOperatorID() int32

func (*OperatorBase) GetParalleID added in v1.2.0

func (o *OperatorBase) GetParalleID() int32

func (*OperatorBase) GetParallelIdx added in v1.2.0

func (o *OperatorBase) GetParallelIdx() int

func (*OperatorBase) GetParallelMajor added in v1.2.0

func (o *OperatorBase) GetParallelMajor() bool

func (*OperatorBase) NumChildren added in v1.2.0

func (o *OperatorBase) NumChildren() int

func (*OperatorBase) SetChildren added in v1.2.0

func (o *OperatorBase) SetChildren(children []Operator)

func (*OperatorBase) SetInfo added in v1.2.0

func (o *OperatorBase) SetInfo(info *OperatorInfo)

type OperatorInfo added in v1.1.0

type OperatorInfo struct {
	Idx           int
	ParallelIdx   int
	ParallelMajor bool
	IsFirst       bool
	IsLast        bool

	CnAddr      string
	OperatorID  int32
	ParallelID  int32
	MaxParallel int32
}

func (OperatorInfo) GetAddress added in v1.2.0

func (info OperatorInfo) GetAddress() process.MessageAddress

Jump to

Keyboard shortcuts

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