Documentation
¶
Index ¶
- Constants
- func CnServerMessageHandler(ctx context.Context, message morpc.Message, cs morpc.ClientSession, ...) error
- func DebugShowScopes(ss []*Scope) string
- func PrintScope(prefix []byte, ss []*Scope)
- type Col
- type Compile
- type Scope
- func (s *Scope) CreateDatabase(c *Compile) error
- func (s *Scope) CreateTable(c *Compile) error
- func (s *Scope) Delete(c *Compile) (uint64, error)
- func (s *Scope) DropDatabase(c *Compile) error
- func (s *Scope) DropTable(c *Compile) error
- func (s *Scope) Insert(c *Compile) (uint64, error)
- func (s *Scope) InsertValues(c *Compile, stmt *tree.Insert) (uint64, error)
- func (s *Scope) JoinRun(c *Compile) error
- func (s *Scope) MergeRun(c *Compile) error
- func (s *Scope) ParallelRun(c *Compile, remote bool) error
- func (s *Scope) PushdownRun(c *Compile) error
- func (s *Scope) RemoteRun(c *Compile) error
- func (s *Scope) Run(c *Compile) (err error)
- func (s *Scope) TruncateTable(c *Compile) error
- func (s *Scope) Update(c *Compile) (uint64, error)
- type Server
- type Source
- type TxnOperator
Constants ¶
const ( Merge = iota Normal Remote Parallel Pushdown CreateDatabase CreateTable CreateIndex DropDatabase DropTable DropIndex Deletion Insert Update InsertValues TruncateTable )
type of scope
const (
Single_Core_Rows = 1000000
)
number of rows per core scheduled to be processed
Variables ¶
This section is empty.
Functions ¶
func CnServerMessageHandler ¶ added in v0.6.0
func CnServerMessageHandler(ctx context.Context, message morpc.Message, cs morpc.ClientSession, storeEngine engine.Engine, fileService fileservice.FileService, cli client.TxnClient, messageAcquirer func() morpc.Message, getClusterDetails engine.GetClusterDetailsFunc) error
CnServerMessageHandler deal the client message that received at cn-server. the message is always *pipeline.Message here. It's a byte array which encoded by method encodeScope. write back Analysis Information and error info if error occurs to client.
func DebugShowScopes ¶ added in v0.6.0
DebugShowScopes show information of a scope structure.
func PrintScope ¶ added in v0.5.0
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 New ¶
func New(addr, db string, sql string, uid string, ctx context.Context, e engine.Engine, proc *process.Process, stmt tree.Statement) *Compile
New is used to new an object of compile
func (*Compile) Compile ¶ added in v0.5.0
Compile is the entrance of the compute-layer, it compiles AST tree to scope list. A scope is an execution unit.
func (*Compile) ConstructScope ¶ added in v0.6.0
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
// IsEnd means the pipeline is join
IsJoin bool
// IsEnd means the pipeline is end
IsEnd bool
// IsRemote means the pipeline is remote
IsRemote 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) CreateTable ¶
func (*Scope) DropDatabase ¶
func (*Scope) InsertValues ¶ added in v0.6.0
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) PushdownRun ¶ added in v0.6.0
func (*Scope) RemoteRun ¶
RemoteRun send the scope to a remote node for execution. if no target node information, just execute it at local.
func (*Scope) TruncateTable ¶ added in v0.6.0
Truncation operations cannot be performed if the session holds an active table lock.
type Server ¶ added in v0.6.0
func (*Server) GetConnector ¶ added in v0.6.0
func (srv *Server) GetConnector(id uint64) *process.WaitRegister
func (*Server) HandleRequest ¶ added in v0.6.0
func (*Server) RegistConnector ¶ added in v0.6.0
func (srv *Server) RegistConnector(reg *process.WaitRegister) uint64
type Source ¶
type Source struct {
PushdownId uint64
PushdownAddr string
SchemaName string
RelationName string
Attributes []string
R engine.Reader
Bat *batch.Batch
Expr *plan.Expr
TableDef *plan.TableDef
Timestamp timestamp.Timestamp
}
Source contains information of a relation which will be used in execution,
type TxnOperator ¶ added in v0.6.0
type TxnOperator = client.TxnOperator