command

package
v0.1.4-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DDLCommandTypeCreateSource = iota
	DDLCommandTypeDropSource
	DDLCommandTypeCreateMV
	DDLCommandTypeDropMV
	DDLCommandTypeCreateIndex
	DDLCommandTypeDropIndex
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateIndexCommand

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

func NewCreateIndexCommand

func NewCreateIndexCommand(e *Executor, schemaName string, createIndexSQL string, tableSequences []uint64) *CreateIndexCommand

func NewOriginatingCreateIndexCommand

func NewOriginatingCreateIndexCommand(e *Executor, pl *parplan.Planner, schema *common.Schema, createIndexSQL string,
	tableSequences []uint64, ast *parser.CreateIndex) *CreateIndexCommand

func (*CreateIndexCommand) AfterPhase

func (c *CreateIndexCommand) AfterPhase(phase int32) error

func (*CreateIndexCommand) Before

func (c *CreateIndexCommand) Before() error

func (*CreateIndexCommand) CommandType

func (c *CreateIndexCommand) CommandType() DDLCommandType

func (*CreateIndexCommand) LockName

func (c *CreateIndexCommand) LockName() string

func (*CreateIndexCommand) NumPhases

func (c *CreateIndexCommand) NumPhases() int

func (*CreateIndexCommand) OnPhase

func (c *CreateIndexCommand) OnPhase(phase int32) error

func (*CreateIndexCommand) SQL

func (c *CreateIndexCommand) SQL() string

func (*CreateIndexCommand) SchemaName

func (c *CreateIndexCommand) SchemaName() string

func (*CreateIndexCommand) TableSequences

func (c *CreateIndexCommand) TableSequences() []uint64

type CreateMVCommand

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

func NewCreateMVCommand

func NewCreateMVCommand(e *Executor, schemaName string, createMVSQL string, tableSequences []uint64) *CreateMVCommand

func NewOriginatingCreateMVCommand

func NewOriginatingCreateMVCommand(e *Executor, pl *parplan.Planner, schema *common.Schema, sql string,
	tableSequences []uint64, ast *parser.CreateMaterializedView) *CreateMVCommand

func (*CreateMVCommand) AfterPhase

func (c *CreateMVCommand) AfterPhase(phase int32) error

func (*CreateMVCommand) Before

func (c *CreateMVCommand) Before() error

func (*CreateMVCommand) CommandType

func (c *CreateMVCommand) CommandType() DDLCommandType

func (*CreateMVCommand) LockName

func (c *CreateMVCommand) LockName() string

func (*CreateMVCommand) NumPhases

func (c *CreateMVCommand) NumPhases() int

func (*CreateMVCommand) OnPhase

func (c *CreateMVCommand) OnPhase(phase int32) error

func (*CreateMVCommand) SQL

func (c *CreateMVCommand) SQL() string

func (*CreateMVCommand) SchemaName

func (c *CreateMVCommand) SchemaName() string

func (*CreateMVCommand) TableSequences

func (c *CreateMVCommand) TableSequences() []uint64

type CreateSourceCommand

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

func NewCreateSourceCommand

func NewCreateSourceCommand(e *Executor, schemaName string, sql string, tableSequences []uint64) *CreateSourceCommand

func NewOriginatingCreateSourceCommand

func NewOriginatingCreateSourceCommand(e *Executor, schemaName string, sql string, tableSequences []uint64, ast *parser.CreateSource) *CreateSourceCommand

func (*CreateSourceCommand) AfterPhase

func (c *CreateSourceCommand) AfterPhase(phase int32) error

func (*CreateSourceCommand) Before

func (c *CreateSourceCommand) Before() error

func (*CreateSourceCommand) CommandType

func (c *CreateSourceCommand) CommandType() DDLCommandType

func (*CreateSourceCommand) LockName

func (c *CreateSourceCommand) LockName() string

func (*CreateSourceCommand) NumPhases

func (c *CreateSourceCommand) NumPhases() int

func (*CreateSourceCommand) OnPhase

func (c *CreateSourceCommand) OnPhase(phase int32) error

func (*CreateSourceCommand) SQL

func (c *CreateSourceCommand) SQL() string

func (*CreateSourceCommand) SchemaName

func (c *CreateSourceCommand) SchemaName() string

func (*CreateSourceCommand) TableSequences

func (c *CreateSourceCommand) TableSequences() []uint64

type DDLCommand

type DDLCommand interface {
	CommandType() DDLCommandType

	SchemaName() string

	SQL() string

	TableSequences() []uint64

	// Before is called on the originating node before the first phase
	Before() error

	// OnPhase is called on every node in the cluster passing in the phase
	OnPhase(phase int32) error

	// AfterPhase is called on the originating node once successful responses from the specified phase have been returned
	AfterPhase(phase int32) error

	LockName() string

	// NumPhases returns the number of phases in the command
	NumPhases() int
}

func NewDDLCommand

func NewDDLCommand(e *Executor, commandType DDLCommandType, schemaName string, sql string, tableSequences []uint64) DDLCommand

type DDLCommandRunner

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

func NewDDLCommandRunner

func NewDDLCommandRunner(ce *Executor) *DDLCommandRunner

func (*DDLCommandRunner) HandleNotification

func (d *DDLCommandRunner) HandleNotification(notification remoting.ClusterMessage) error

func (*DDLCommandRunner) RunCommand

func (d *DDLCommandRunner) RunCommand(command DDLCommand) error

func (*DDLCommandRunner) RunWithLock

func (d *DDLCommandRunner) RunWithLock(command DDLCommand, ddlInfo *notifications.DDLStatementInfo) error

type DDLCommandType

type DDLCommandType int

type DropIndexCommand

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

func NewDropIndexCommand

func NewDropIndexCommand(e *Executor, schemaName string, sql string) *DropIndexCommand

func NewOriginatingDropIndexCommand

func NewOriginatingDropIndexCommand(e *Executor, schemaName string, sql string, tableName string, indexName string) *DropIndexCommand

func (*DropIndexCommand) AfterPhase

func (c *DropIndexCommand) AfterPhase(phase int32) error

func (*DropIndexCommand) Before

func (c *DropIndexCommand) Before() error

func (*DropIndexCommand) CommandType

func (c *DropIndexCommand) CommandType() DDLCommandType

func (*DropIndexCommand) LockName

func (c *DropIndexCommand) LockName() string

func (*DropIndexCommand) NumPhases

func (c *DropIndexCommand) NumPhases() int

func (*DropIndexCommand) OnPhase

func (c *DropIndexCommand) OnPhase(phase int32) error

func (*DropIndexCommand) SQL

func (c *DropIndexCommand) SQL() string

func (*DropIndexCommand) SchemaName

func (c *DropIndexCommand) SchemaName() string

func (*DropIndexCommand) TableSequences

func (c *DropIndexCommand) TableSequences() []uint64

type DropMVCommand

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

func NewDropMVCommand

func NewDropMVCommand(e *Executor, schemaName string, sql string) *DropMVCommand

func NewOriginatingDropMVCommand

func NewOriginatingDropMVCommand(e *Executor, schemaName string, sql string, mvName string) *DropMVCommand

func (*DropMVCommand) AfterPhase

func (c *DropMVCommand) AfterPhase(phase int32) error

func (*DropMVCommand) Before

func (c *DropMVCommand) Before() error

func (*DropMVCommand) CommandType

func (c *DropMVCommand) CommandType() DDLCommandType

func (*DropMVCommand) LockName

func (c *DropMVCommand) LockName() string

func (*DropMVCommand) NumPhases

func (c *DropMVCommand) NumPhases() int

func (*DropMVCommand) OnPhase

func (c *DropMVCommand) OnPhase(phase int32) error

func (*DropMVCommand) SQL

func (c *DropMVCommand) SQL() string

func (*DropMVCommand) SchemaName

func (c *DropMVCommand) SchemaName() string

func (*DropMVCommand) TableSequences

func (c *DropMVCommand) TableSequences() []uint64

type DropSourceCommand

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

func NewDropSourceCommand

func NewDropSourceCommand(e *Executor, schemaName string, sql string) *DropSourceCommand

func NewOriginatingDropSourceCommand

func NewOriginatingDropSourceCommand(e *Executor, schemaName string, sql string, sourceName string) *DropSourceCommand

func (*DropSourceCommand) AfterPhase

func (c *DropSourceCommand) AfterPhase(phase int32) error

func (*DropSourceCommand) Before

func (c *DropSourceCommand) Before() error

func (*DropSourceCommand) CommandType

func (c *DropSourceCommand) CommandType() DDLCommandType

func (*DropSourceCommand) LockName

func (c *DropSourceCommand) LockName() string

func (*DropSourceCommand) NumPhases

func (c *DropSourceCommand) NumPhases() int

func (*DropSourceCommand) OnPhase

func (c *DropSourceCommand) OnPhase(phase int32) error

func (*DropSourceCommand) SQL

func (c *DropSourceCommand) SQL() string

func (*DropSourceCommand) SchemaName

func (c *DropSourceCommand) SchemaName() string

func (*DropSourceCommand) TableSequences

func (c *DropSourceCommand) TableSequences() []uint64

type Executor

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

func NewCommandExecutor

func NewCommandExecutor(metaController *meta.Controller, pushEngine *push.Engine, pullEngine *pull.Engine,
	cluster cluster.Cluster, notifClient remoting.Client, protoRegistry protolib.Resolver,
	failureInjector failinject.Injector) *Executor

func (*Executor) CreateExecutionContext

func (e *Executor) CreateExecutionContext(schema *common.Schema) *execctx.ExecutionContext

func (*Executor) ExecuteSQLStatement

func (e *Executor) ExecuteSQLStatement(execCtx *execctx.ExecutionContext, sql string, argTypes []common.ColumnType,
	args []interface{}) (exec.PullExecutor, error)

ExecuteSQLStatement executes a synchronous SQL statement.

func (*Executor) FailureInjector

func (e *Executor) FailureInjector() failinject.Injector

func (*Executor) GetPullEngine

func (e *Executor) GetPullEngine() *pull.Engine

func (*Executor) GetPushEngine

func (e *Executor) GetPushEngine() *push.Engine

GetPushEngine is only used in testing

func (*Executor) HandleMessage

func (e *Executor) HandleMessage(notification remoting.ClusterMessage) (remoting.ClusterMessage, error)

func (*Executor) RunningCommands

func (e *Executor) RunningCommands() int

func (*Executor) Start

func (e *Executor) Start() error

func (*Executor) Stop

func (e *Executor) Stop() error

Directories

Path Synopsis
Package parser contains the command parser.
Package parser contains the command parser.
selector
Package selector contains a selector library for JSON and Protobuf.
Package selector contains a selector library for JSON and Protobuf.

Jump to

Keyboard shortcuts

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