mysqld

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockGetClient

func MockGetClient(t *testing.T, svrConn string) (*xrpc.Client, func())

MockGetClient used to mock client.

Types

type ArgsHandler

type ArgsHandler interface {
	// mysqld start args
	Start() []string

	// mysqld stop args
	Stop() []string

	// mysqld isrunning args
	IsRunning() []string

	// mysqld kill args
	Kill() []string
}

ArgsHandler for mysqld operation.

type Backup

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

Backup tuple.

func NewBackup

func NewBackup(conf *config.BackupConfig, log *xlog.Log) *Backup

NewBackup creates new backup tuple.

func (*Backup) ApplyLog

func (b *Backup) ApplyLog(req *model.BackupRPCRequest) error

ApplyLog used to apply log from backupdir.

func (*Backup) Backup

func (b *Backup) Backup(req *model.BackupRPCRequest) error

Backup used to start a backup job. If we got CHECKTIMES BACKUPOK in outputs, the backup is completed.

func (*Backup) Cancel

func (b *Backup) Cancel() error

Cancel used to cancel a backup/applylog job.

func (*Backup) IncApplyLogErrs

func (s *Backup) IncApplyLogErrs()

IncApplyLogErrs used to increase the apply error counter.

func (*Backup) IncApplyLogs

func (s *Backup) IncApplyLogs()

IncApplyLogs used to increase the apply counter.

func (*Backup) IncBackupErrs

func (s *Backup) IncBackupErrs()

IncBackupErrs used to increase the backup error counter.

func (*Backup) IncBackups

func (s *Backup) IncBackups()

IncBackups used to increase the backup counter.

func (*Backup) IncCancels

func (s *Backup) IncCancels()

IncCancels used to increase the backup cancel counter.

func (*Backup) SetCMDHandler

func (b *Backup) SetCMDHandler(h common.Command)

SetCMDHandler used to set the command handler.

type BackupRPC

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

BackupRPC tuple.

func (*BackupRPC) CancelBackup

func (b *BackupRPC) CancelBackup(req *model.BackupRPCRequest, rsp *model.BackupRPCResponse) error

CancelBackup used to cancel the job of backup.

func (*BackupRPC) DoApplyLog

func (b *BackupRPC) DoApplyLog(req *model.BackupRPCRequest, rsp *model.BackupRPCResponse) error

DoApplyLog used to execute the apply log command.

func (*BackupRPC) DoBackup

func (b *BackupRPC) DoBackup(req *model.BackupRPCRequest, rsp *model.BackupRPCResponse) error

DoBackup used to execute the xtrabackup command.

type LinuxArgs

type LinuxArgs struct {
	ArgsHandler
	// contains filtered or unexported fields
}

LinuxArgs tuple.

func NewLinuxArgs

func NewLinuxArgs(conf *config.BackupConfig) *LinuxArgs

NewLinuxArgs creates new LinuxArgs.

func (*LinuxArgs) IsRunning

func (l *LinuxArgs) IsRunning() []string

IsRunning used to check the mysqld is running or not.

func (*LinuxArgs) Kill

func (l *LinuxArgs) Kill() []string

Kill used to kill -9 the mysqld process.

func (*LinuxArgs) Start

func (l *LinuxArgs) Start() []string

Start used to start mysqld.

func (*LinuxArgs) Stop

func (l *LinuxArgs) Stop() []string

Stop used to stop the mysqld.

type MockArgs

type MockArgs struct {
	ArgsHandler
}

MockArgs tuple.

func NewMockArgs

func NewMockArgs() *MockArgs

NewMockArgs creates the new MockArgs.

func (*MockArgs) IsRunning

func (l *MockArgs) IsRunning() []string

IsRunning used to check the mock running.

func (*MockArgs) Kill

func (l *MockArgs) Kill() []string

Kill used to kill the mock.

func (*MockArgs) Start

func (l *MockArgs) Start() []string

Start used to start the mock.

func (*MockArgs) Stop

func (l *MockArgs) Stop() []string

Stop used to stop the mock.

type Mysqld

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

Mysqld tuple.

func MockMysqld

func MockMysqld(log *xlog.Log, port int) (string, *Mysqld, func())

MockMysqld used to mock a mysqld.

func NewMysqld

func NewMysqld(conf *config.BackupConfig, log *xlog.Log) *Mysqld

NewMysqld creates the new Mysqld.

func (*Mysqld) GetBackupRPC

func (m *Mysqld) GetBackupRPC() *BackupRPC

GetBackupRPC returns BackupRPC tuple.

func (*Mysqld) GetMysqldRPC

func (m *Mysqld) GetMysqldRPC() *MysqldRPC

GetMysqldRPC returns MysqldRPC tuple.

func (*Mysqld) IncMonitorStarts

func (s *Mysqld) IncMonitorStarts()

IncMonitorStarts used to increase the monitor start counter.

func (*Mysqld) IncMonitorStops

func (s *Mysqld) IncMonitorStops()

IncMonitorStops used to increase the monitor stop counter.

func (*Mysqld) IncMysqldStarts

func (s *Mysqld) IncMysqldStarts()

IncMysqldStarts used to increase the mysql start counter.

func (*Mysqld) IncMysqldStops

func (s *Mysqld) IncMysqldStops()

IncMysqldStops used to increase the mysql stop counter.

func (*Mysqld) KillMysqld

func (m *Mysqld) KillMysqld() error

KillMysqld is used to shutdown mysql before we rebuild it.

func (*Mysqld) MonitorStart

func (m *Mysqld) MonitorStart()

MonitorStart used to monite mysqld_safe is running or not.

func (*Mysqld) MonitorStop

func (m *Mysqld) MonitorStop()

MonitorStop used to stop the monitor.

func (*Mysqld) SetArgsHandler

func (m *Mysqld) SetArgsHandler(h ArgsHandler)

SetArgsHandler used to set the args handler.

func (*Mysqld) StartMysqld

func (m *Mysqld) StartMysqld() error

StartMysqld used to start mysql using mysqld_safe.

func (*Mysqld) StopMysqld

func (m *Mysqld) StopMysqld() error

StopMysqld used to shutdown mysqld using mysqldadmin.

type MysqldRPC

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

MysqldRPC tuple.

func (*MysqldRPC) IsRunning

func (m *MysqldRPC) IsRunning(req *model.MysqldRPCRequest, rsp *model.MysqldRPCResponse) error

IsRunning used to check the mysqld is running or not.

func (*MysqldRPC) Kill

Kill used to kill the mysqld.

func (*MysqldRPC) ShutDown

func (m *MysqldRPC) ShutDown(req *model.MysqldRPCRequest, rsp *model.MysqldRPCResponse) error

ShutDown used to shutdown the mysql server.

func (*MysqldRPC) Start

Start used to start the mysql server.

func (*MysqldRPC) StartMonitor

func (m *MysqldRPC) StartMonitor(req *model.MysqldRPCRequest, rsp *model.MysqldRPCResponse) error

StartMonitor used to start the monitor.

func (*MysqldRPC) Status

Status used to get all the status of the backup.

func (*MysqldRPC) StopMonitor

func (m *MysqldRPC) StopMonitor(req *model.MysqldRPCRequest, rsp *model.MysqldRPCResponse) error

StopMonitor used to stop the monitor.

Jump to

Keyboard shortcuts

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