task

package
v1.1.0-beta.0...-9958228 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOptGroupTask

func NewOptGroupTask(ctx cascadesctx.CascadesContext, g *memo.Group) base.Task

NewOptGroupTask returns a new optimizing group task.

func NewSimpleTaskScheduler

func NewSimpleTaskScheduler() base.Scheduler

NewSimpleTaskScheduler return a simple task scheduler, init logic included.

Types

type ApplyRuleTask

type ApplyRuleTask struct {
	BaseTask
	// contains filtered or unexported fields
}

ApplyRuleTask is a wrapper of running basic logic union of scheduling apply rule.

func NewApplyRuleTask

func NewApplyRuleTask(ctx cascadesctx.CascadesContext, gE *memo.GroupExpression, r rule.Rule) *ApplyRuleTask

NewApplyRuleTask return a new apply rule task.

func (*ApplyRuleTask) Desc

func (a *ApplyRuleTask) Desc(w util.StrBufferWriter)

Desc implements the task.Desc interface.

func (*ApplyRuleTask) Execute

func (a *ApplyRuleTask) Execute() error

Execute implements the task.Execute interface.

type BaseTask

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

BaseTask is base task wrapper structure for encapsulating basic things.

func (*BaseTask) Push

func (b *BaseTask) Push(t base.Task)

Push pushes a new task into inside stack.

type OptGroupExpressionTask

type OptGroupExpressionTask struct {
	BaseTask
	// contains filtered or unexported fields
}

OptGroupExpressionTask is a wrapper of running logic of exploring group expression.

func NewOptGroupExpressionTask

func NewOptGroupExpressionTask(ctx cascadesctx.CascadesContext, ge *memo.GroupExpression) *OptGroupExpressionTask

NewOptGroupExpressionTask return a targeting optimizing group expression task.

func (*OptGroupExpressionTask) Desc

Desc implements the task.Desc interface.

func (*OptGroupExpressionTask) Execute

func (ge *OptGroupExpressionTask) Execute() error

Execute implements the task.Execute interface.

type OptGroupTask

type OptGroupTask struct {
	BaseTask
	// contains filtered or unexported fields
}

OptGroupTask is a wrapper of running logic of exploring a group.

func (*OptGroupTask) Desc

func (g *OptGroupTask) Desc(w util.StrBufferWriter)

Desc implements the task.Desc interface.

func (*OptGroupTask) Execute

func (g *OptGroupTask) Execute() error

Execute implements the task.Execute interface.

type SimpleTaskScheduler

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

SimpleTaskScheduler is defined for serializing scheduling of memo tasks.

func (*SimpleTaskScheduler) Destroy

func (s *SimpleTaskScheduler) Destroy()

Destroy release all the allocated elements inside stack.

func (*SimpleTaskScheduler) ExecuteTasks

func (s *SimpleTaskScheduler) ExecuteTasks() error

ExecuteTasks implements the interface of TaskScheduler.

func (*SimpleTaskScheduler) PushTask

func (s *SimpleTaskScheduler) PushTask(task base.Task)

PushTask implements the scheduler's interface, add another task into scheduler.

type Stack

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

Stack is used to store the optimizing tasks created before or during the optimizing process.

func (*Stack) Desc

func (ts *Stack) Desc(w util.StrBufferWriter)

Desc is used to desc the detail info about current stack state. when use customized stack to drive the tasks, the call-chain state is dived in the stack.

func (*Stack) Destroy

func (ts *Stack) Destroy()

Destroy indicates that when stack itself is useless like in the end of optimizing phase, we can destroy ourselves.

func (*Stack) Empty

func (ts *Stack) Empty() bool

Empty indicates whether taskStack is empty.

func (*Stack) Len

func (ts *Stack) Len() int

Len indicates the length of current stack.

func (*Stack) Pop

func (ts *Stack) Pop() base.Task

Pop indicates to pop one task out of the stack.

func (*Stack) Push

func (ts *Stack) Push(one base.Task)

Push indicates to push one task into the stack.

Jump to

Keyboard shortcuts

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