vreplication

package
v3.0.0-rc.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2018 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddStatusPart

func AddStatusPart()

AddStatusPart adds the vreplication status to the status page.

func StatusSummary

func StatusSummary() (maxSecondsBehindMaster int64, binlogPlayersCount int32)

StatusSummary returns the summary status of vreplication.

Types

type ControllerStatus

type ControllerStatus struct {
	Index               uint32
	Source              string
	SourceShard         string
	StopPosition        string
	LastPosition        string
	SecondsBehindMaster int64
	Counts              map[string]int64
	Rates               map[string][]float64
	State               string
	SourceTablet        string
	Messages            []string
}

ControllerStatus contains a renderable status of a controller.

type Engine

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

Engine is the engine for handling vreplication.

func NewEngine

func NewEngine(ts *topo.Server, cell string, mysqld mysqlctl.MysqlDaemon, dbClientFactory func() binlogplayer.DBClient) *Engine

NewEngine creates a new Engine. A nil ts means that the Engine is disabled.

func (*Engine) Close

func (vre *Engine) Close()

Close closes the Engine service.

func (*Engine) Exec

func (vre *Engine) Exec(query string) (*sqltypes.Result, error)

Exec executes the query and the related actions. Example insert statement: insert into _vt.vreplication

(workflow, source, pos, max_tps, max_replication_lag, time_updated, transaction_timestamp, state)
values ('Resharding', 'keyspace:"ks" shard:"0" tables:"a" tables:"b" ', 'MariaDB/0-1-1083', 9223372036854775807, 9223372036854775807, 481823, 0, 'Running')`

Example update statement: update _vt.vreplication set state='Stopped', message='testing stop' where id=1 Example delete: delete from _vt.vreplication where id=1 Example select: select * from _vt.vreplication

func (*Engine) IsOpen

func (vre *Engine) IsOpen() bool

IsOpen returns true if Engine is open.

func (*Engine) Open

func (vre *Engine) Open(ctx context.Context) error

Open starts the Engine service.

func (*Engine) WaitForPos

func (vre *Engine) WaitForPos(ctx context.Context, id int, pos string) error

WaitForPos waits for the replication to reach the specified position.

type EngineStatus

type EngineStatus struct {
	IsOpen      bool
	Controllers []*ControllerStatus
}

EngineStatus contains a renderable status of the Engine.

Jump to

Keyboard shortcuts

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