Documentation ¶
Index ¶
- Variables
- func AdvertiseHost(listen string) string
- func CompVersion(comp string, version utils.Version) string
- type Config
- type Drainer
- type Instance
- type PDInstance
- func (inst *PDInstance) Addr() string
- func (inst *PDInstance) Component() string
- func (inst *PDInstance) InitCluster(pds []*PDInstance) *PDInstance
- func (inst *PDInstance) Join(pds []*PDInstance) *PDInstance
- func (inst *PDInstance) LogFile() string
- func (inst *PDInstance) Name() string
- func (inst *PDInstance) Start(ctx context.Context, version utils.Version) error
- func (inst *PDInstance) StatusAddrs() (addrs []string)
- type Process
- type Pump
- type TiCDC
- type TiDBInstance
- type TiFlashInstance
- func (inst *TiFlashInstance) Addr() string
- func (inst *TiFlashInstance) Cmd() *exec.Cmd
- func (inst *TiFlashInstance) Component() string
- func (inst *TiFlashInstance) LogFile() string
- func (inst *TiFlashInstance) Start(ctx context.Context, version utils.Version) error
- func (inst *TiFlashInstance) StatusAddrs() (addrs []string)
- func (inst *TiFlashInstance) StoreAddr() string
- type TiKVInstance
- func (inst *TiKVInstance) Addr() string
- func (inst *TiKVInstance) Component() string
- func (inst *TiKVInstance) LogFile() string
- func (inst *TiKVInstance) Start(ctx context.Context, version utils.Version) error
- func (inst *TiKVInstance) StatusAddrs() (addrs []string)
- func (inst *TiKVInstance) StoreAddr() string
Constants ¶
This section is empty.
Variables ¶
var SysProcAttr = &syscall.SysProcAttr{ Pdeathsig: syscall.SIGKILL, Setpgid: true, }
SysProcAttr to be use for every Process we start.
Functions ¶
func AdvertiseHost ¶
AdvertiseHost returns the interface's ip addr if listen host is 0.0.0.0
Types ¶
type Config ¶
type Config struct { ConfigPath string `yaml:"config_path"` BinPath string `yaml:"bin_path"` Num int `yaml:"num"` Host string `yaml:"host"` Port int `yaml:"port"` UpTimeout int `yaml:"up_timeout"` }
Config of the instance.
type Drainer ¶
type Drainer struct { Process // contains filtered or unexported fields }
Drainer represent a drainer instance.
func NewDrainer ¶
func NewDrainer(binPath string, dir, host, configPath string, id int, pds []*PDInstance) *Drainer
NewDrainer create a Drainer instance.
func (*Drainer) StatusAddrs ¶
func (inst *Drainer) StatusAddrs() (addrs []string)
type Instance ¶
type Instance interface { Pid() int // Start the instance process. // Will kill the process once the context is done. Start(ctx context.Context, version utils.Version) error // Component Return the component name. Component() string // LogFile return the log file name LogFile() string // Uptime show uptime. Uptime() string // StatusAddrs return the address to pull metrics. StatusAddrs() []string // Wait Should only call this if the instance is started successfully. // The implementation should be safe to call Wait multi times. Wait() error }
Instance represent running component
type PDInstance ¶
type PDInstance struct { Process // contains filtered or unexported fields }
PDInstance represent a running pd-server
func NewPDInstance ¶
func NewPDInstance(binPath, dir, host, configPath string, id int) *PDInstance
NewPDInstance return a PDInstance
func (*PDInstance) Addr ¶
func (inst *PDInstance) Addr() string
Addr return the listen address of PD
func (*PDInstance) Component ¶
func (inst *PDInstance) Component() string
Component return the component name.
func (*PDInstance) InitCluster ¶
func (inst *PDInstance) InitCluster(pds []*PDInstance) *PDInstance
InitCluster set the init cluster instance.
func (*PDInstance) Join ¶
func (inst *PDInstance) Join(pds []*PDInstance) *PDInstance
Join set endpoints field of PDInstance
func (*PDInstance) StatusAddrs ¶
func (inst *PDInstance) StatusAddrs() (addrs []string)
type Process ¶
type Process interface { Start() error Wait() error Pid() int Uptime() string SetOutputFile(fname string) error Cmd() *exec.Cmd }
Process represent process to be run by playground
type Pump ¶
type Pump struct { Process // contains filtered or unexported fields }
Pump represent a pump instance.
func NewPump ¶
func NewPump(binPath string, dir, host, configPath string, id int, pds []*PDInstance) *Pump
NewPump create a Pump instance.
func (*Pump) StatusAddrs ¶
func (inst *Pump) StatusAddrs() (addrs []string)
type TiCDC ¶
type TiCDC struct { Process // contains filtered or unexported fields }
TiCDC represent a ticdc instance.
func NewTiCDC ¶
func NewTiCDC(binPath string, dir, host, configPath string, id int, pds []*PDInstance) *TiCDC
NewTiCDC create a TiCDC instance.
func (*TiCDC) StatusAddrs ¶
func (inst *TiCDC) StatusAddrs() (addrs []string)
type TiDBInstance ¶
type TiDBInstance struct { Process // contains filtered or unexported fields }
TiDBInstance represent a running tidb-server
func NewTiDBInstance ¶
func NewTiDBInstance(binPath string, dir, host, configPath string, id, port int, pds []*PDInstance, enableBinlog bool) *TiDBInstance
NewTiDBInstance return a TiDBInstance
func (*TiDBInstance) Addr ¶
func (inst *TiDBInstance) Addr() string
Addr return the listen address of TiDB
func (*TiDBInstance) Component ¶
func (inst *TiDBInstance) Component() string
Component return the component name.
func (*TiDBInstance) LogFile ¶
func (inst *TiDBInstance) LogFile() string
LogFile return the log file name.
func (*TiDBInstance) StatusAddrs ¶
func (inst *TiDBInstance) StatusAddrs() (addrs []string)
type TiFlashInstance ¶
type TiFlashInstance struct { TCPPort int ServicePort int ProxyPort int ProxyStatusPort int ProxyConfigPath string Process // contains filtered or unexported fields }
TiFlashInstance represent a running TiFlash
func NewTiFlashInstance ¶
func NewTiFlashInstance(binPath, dir, host, configPath string, id int, pds []*PDInstance, dbs []*TiDBInstance) *TiFlashInstance
NewTiFlashInstance return a TiFlashInstance
func (*TiFlashInstance) Addr ¶
func (inst *TiFlashInstance) Addr() string
Addr return the address of tiflash
func (*TiFlashInstance) Cmd ¶
func (inst *TiFlashInstance) Cmd() *exec.Cmd
Cmd returns the internal Cmd instance
func (*TiFlashInstance) Component ¶
func (inst *TiFlashInstance) Component() string
Component return the component name.
func (*TiFlashInstance) LogFile ¶
func (inst *TiFlashInstance) LogFile() string
LogFile return the log file name.
func (*TiFlashInstance) StatusAddrs ¶
func (inst *TiFlashInstance) StatusAddrs() (addrs []string)
StatusAddrs implements Instance interface.
func (*TiFlashInstance) StoreAddr ¶
func (inst *TiFlashInstance) StoreAddr() string
StoreAddr return the store address of TiFlash
type TiKVInstance ¶
type TiKVInstance struct { Process // contains filtered or unexported fields }
TiKVInstance represent a running tikv-server
func NewTiKVInstance ¶
func NewTiKVInstance(binPath string, dir, host, configPath string, id int, pds []*PDInstance) *TiKVInstance
NewTiKVInstance return a TiKVInstance
func (*TiKVInstance) Addr ¶
func (inst *TiKVInstance) Addr() string
Addr return the address of tikv.
func (*TiKVInstance) Component ¶
func (inst *TiKVInstance) Component() string
Component return the component name.
func (*TiKVInstance) LogFile ¶
func (inst *TiKVInstance) LogFile() string
LogFile return the log file name.
func (*TiKVInstance) StatusAddrs ¶
func (inst *TiKVInstance) StatusAddrs() (addrs []string)
func (*TiKVInstance) StoreAddr ¶
func (inst *TiKVInstance) StoreAddr() string
StoreAddr return the store address of TiKV