Documentation
¶
Index ¶
- func MockGetClient(t *testing.T, svrConn string) (*xrpc.Client, func())
- type ArgsHandler
- type Backup
- func (b *Backup) ApplyLog(req *model.BackupRPCRequest) error
- func (b *Backup) Backup(req *model.BackupRPCRequest) error
- func (b *Backup) Cancel() error
- func (s *Backup) IncApplyLogErrs()
- func (s *Backup) IncApplyLogs()
- func (s *Backup) IncBackupErrs()
- func (s *Backup) IncBackups()
- func (s *Backup) IncCancels()
- func (b *Backup) SetCMDHandler(h common.Command)
- type BackupRPC
- type LinuxArgs
- type MockArgs
- type Mysqld
- func (m *Mysqld) GetBackupRPC() *BackupRPC
- func (m *Mysqld) GetMysqldRPC() *MysqldRPC
- func (s *Mysqld) IncMonitorStarts()
- func (s *Mysqld) IncMonitorStops()
- func (s *Mysqld) IncMysqldStarts()
- func (s *Mysqld) IncMysqldStops()
- func (m *Mysqld) KillMysqld() error
- func (m *Mysqld) MonitorStart()
- func (m *Mysqld) MonitorStop()
- func (m *Mysqld) SetArgsHandler(h ArgsHandler)
- func (m *Mysqld) StartMysqld() error
- func (m *Mysqld) StopMysqld() error
- type MysqldRPC
- func (m *MysqldRPC) IsRunning(req *model.MysqldRPCRequest, rsp *model.MysqldRPCResponse) error
- func (m *MysqldRPC) Kill(req *model.MysqldRPCRequest, rsp *model.MysqldRPCResponse) error
- func (m *MysqldRPC) ShutDown(req *model.MysqldRPCRequest, rsp *model.MysqldRPCResponse) error
- func (m *MysqldRPC) Start(req *model.MysqldRPCRequest, rsp *model.MysqldRPCResponse) error
- func (m *MysqldRPC) StartMonitor(req *model.MysqldRPCRequest, rsp *model.MysqldRPCResponse) error
- func (m *MysqldRPC) Status(req *model.MysqldStatusRPCRequest, rsp *model.MysqldStatusRPCResponse) error
- func (m *MysqldRPC) StopMonitor(req *model.MysqldRPCRequest, rsp *model.MysqldRPCResponse) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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) 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 ¶
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.
type MockArgs ¶
type MockArgs struct {
ArgsHandler
}
MockArgs tuple.
type Mysqld ¶
type Mysqld struct {
// contains filtered or unexported fields
}
Mysqld tuple.
func MockMysqld ¶
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 ¶
GetBackupRPC returns BackupRPC tuple.
func (*Mysqld) GetMysqldRPC ¶
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 ¶
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) SetArgsHandler ¶
func (m *Mysqld) SetArgsHandler(h ArgsHandler)
SetArgsHandler used to set the args handler.
func (*Mysqld) StartMysqld ¶
StartMysqld used to start mysql using mysqld_safe.
func (*Mysqld) StopMysqld ¶
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 ¶
func (m *MysqldRPC) Kill(req *model.MysqldRPCRequest, rsp *model.MysqldRPCResponse) error
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 ¶
func (m *MysqldRPC) Start(req *model.MysqldRPCRequest, rsp *model.MysqldRPCResponse) error
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 ¶
func (m *MysqldRPC) Status(req *model.MysqldStatusRPCRequest, rsp *model.MysqldStatusRPCResponse) error
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.