Documentation
¶
Index ¶
- Constants
- Variables
- func InitAddress(addr string)
- func PrintScope(prefix []byte, ss []*Scope)
- type Col
- type Compile
- type Scope
- func (s *Scope) CreateDatabase(ts uint64, snapshot engine.Snapshot, engine engine.Engine) error
- func (s *Scope) CreateIndex(ts uint64, snapshot engine.Snapshot, engine engine.Engine) error
- func (s *Scope) CreateTable(ts uint64, snapshot engine.Snapshot, engine engine.Engine, dbName string) error
- func (s *Scope) Delete(ts uint64, snapshot engine.Snapshot, engine engine.Engine) (uint64, error)
- func (s *Scope) DispatchRun(e engine.Engine) error
- func (s *Scope) DropDatabase(ts uint64, snapshot engine.Snapshot, engine engine.Engine) error
- func (s *Scope) DropIndex(ts uint64, snapshot engine.Snapshot, engine engine.Engine) error
- func (s *Scope) DropTable(ts uint64, snapshot engine.Snapshot, engine engine.Engine) error
- func (s *Scope) Insert(ts uint64, snapshot engine.Snapshot, engine engine.Engine) (uint64, error)
- func (s *Scope) MergeRun(e engine.Engine) error
- func (s *Scope) NumCPU() int
- func (s *Scope) ParallelRun(e engine.Engine) error
- func (s *Scope) RemoteRun(e engine.Engine) error
- func (s *Scope) Run(e engine.Engine) (err error)
- func (s *Scope) Update(ts uint64, snapshot engine.Snapshot, engine engine.Engine) (uint64, error)
- type Source
Constants ¶
View Source
const ( Merge = iota Normal Remote Parallel CreateDatabase CreateTable CreateIndex DropDatabase DropTable DropIndex Deletion Insert Update )
type of scope
Variables ¶
View Source
var Address string
Address is the ip:port of local node
Functions ¶
func PrintScope ¶ added in v0.5.0
Print is to format scope list
Types ¶
type Compile ¶ added in v0.5.0
type Compile struct {
// contains filtered or unexported fields
}
Compile contains all the information needed for compilation.
func (*Compile) Compile ¶ added in v0.5.0
func (c *Compile) Compile(pn *plan.Plan, u interface{}, fill func(interface{}, *batch.Batch) error) (err error)
Compile is the entrance of the compute-layer, it compiles AST tree to scope list. A scope is an execution unit.
func (*Compile) GetAffectedRows ¶ added in v0.5.0
type Scope ¶
type Scope struct {
// Magic specifies the type of Scope.
// 0 - execution unit for reading data.
// 1 - execution unit for processing intermediate results.
// 2 - execution unit that requires remote call.
Magic int
// used for dispatch
DispatchAll bool
Plan *plan.Plan
// DataSource stores information about data source.
DataSource *Source
// PreScopes contains children of this scope will inherit and execute.
PreScopes []*Scope
// NodeInfo contains the information about the remote node.
NodeInfo engine.Node
// Instructions contains command list of this scope.
Instructions vm.Instructions
// Proc contains the execution context.
Proc *process.Process
Reg *process.WaitRegister
}
Scope is the output of the compile process. Each sql will be compiled to one or more execution unit scopes.
func (*Scope) CreateDatabase ¶
func (*Scope) CreateIndex ¶
func (*Scope) CreateTable ¶
func (*Scope) DropDatabase ¶
func (*Scope) MergeRun ¶
MergeRun range and run the scope's pre-scopes by go-routine, and finally run itself to do merge work.
func (*Scope) ParallelRun ¶
ParallelRun try to execute the scope in parallel way.
func (*Scope) RemoteRun ¶
RemoteRun send the scope to a remote node (if target node is itself, it is same to function ParallelRun) and run it.
Click to show internal directories.
Click to hide internal directories.