Documentation ¶
Index ¶
- Variables
- func CompVersion(comp string, version v0manifest.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 v0manifest.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 v0manifest.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 v0manifest.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, }
SysProcAttr to be use for every Process we start.
Functions ¶
func CompVersion ¶ added in v1.0.5
func CompVersion(comp string, version v0manifest.Version) string
CompVersion return the format to run specified version of a component.
Types ¶
type Drainer ¶ added in v1.0.5
type Drainer struct { Process // contains filtered or unexported fields }
Drainer represent a drainer instance.
func NewDrainer ¶ added in v1.0.5
func NewDrainer(binPath string, dir, host, configPath string, id int, pds []*PDInstance) *Drainer
NewDrainer create a Drainer instance.
func (*Drainer) StatusAddrs ¶ added in v1.0.5
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 v0manifest.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 ¶ added in v1.0.7
func (inst *PDInstance) Component() string
Component return the component name.
func (*PDInstance) InitCluster ¶ added in v1.0.3
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) LogFile ¶ added in v1.0.7
func (inst *PDInstance) LogFile() string
LogFile return the log file.
func (*PDInstance) Name ¶ added in v1.0.5
func (inst *PDInstance) Name() string
Name return the name of pd.
func (*PDInstance) Start ¶
func (inst *PDInstance) Start(ctx context.Context, version v0manifest.Version) error
Start calls set inst.cmd and Start
func (*PDInstance) StatusAddrs ¶ added in v1.0.4
func (inst *PDInstance) StatusAddrs() (addrs []string)
type Process ¶ added in v1.0.7
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
func NewComponentProcess ¶ added in v1.0.8
func NewComponentProcess(ctx context.Context, dir, binPath, component string, version v0manifest.Version, arg ...string) (Process, error)
NewComponentProcess create a Process instance.
type Pump ¶ added in v1.0.5
type Pump struct { Process // contains filtered or unexported fields }
Pump represent a pump instance.
func NewPump ¶ added in v1.0.5
func NewPump(binPath string, dir, host, configPath string, id int, pds []*PDInstance) *Pump
NewPump create a Pump instance.
func (*Pump) StatusAddrs ¶ added in v1.0.5
func (inst *Pump) StatusAddrs() (addrs []string)
type TiCDC ¶ added in v1.2.0
type TiCDC struct { Process // contains filtered or unexported fields }
TiCDC represent a ticdc instance.
func NewTiCDC ¶ added in v1.2.0
func NewTiCDC(binPath string, dir, host, configPath string, id int, pds []*PDInstance) *TiCDC
NewTiCDC create a TiCDC instance.
func (*TiCDC) StatusAddrs ¶ added in v1.2.0
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 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 ¶ added in v1.0.7
func (inst *TiDBInstance) Component() string
Component return the component name.
func (*TiDBInstance) LogFile ¶ added in v1.0.7
func (inst *TiDBInstance) LogFile() string
LogFile return the log file name.
func (*TiDBInstance) Start ¶
func (inst *TiDBInstance) Start(ctx context.Context, version v0manifest.Version) error
Start calls set inst.cmd and Start
func (*TiDBInstance) StatusAddrs ¶ added in v1.0.4
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 ¶ added in v1.0.5
func (inst *TiFlashInstance) Addr() string
Addr return the address of tiflash
func (*TiFlashInstance) Cmd ¶ added in v1.0.4
func (inst *TiFlashInstance) Cmd() *exec.Cmd
Cmd returns the internal Cmd instance
func (*TiFlashInstance) Component ¶ added in v1.0.7
func (inst *TiFlashInstance) Component() string
Component return the component name.
func (*TiFlashInstance) LogFile ¶ added in v1.0.7
func (inst *TiFlashInstance) LogFile() string
LogFile return the log file name.
func (*TiFlashInstance) Start ¶
func (inst *TiFlashInstance) Start(ctx context.Context, version v0manifest.Version) error
Start calls set inst.cmd and Start
func (*TiFlashInstance) StatusAddrs ¶ added in v1.0.4
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 ¶ added in v1.0.5
func (inst *TiKVInstance) Addr() string
Addr return the address of tikv.
func (*TiKVInstance) Component ¶ added in v1.0.7
func (inst *TiKVInstance) Component() string
Component return the component name.
func (*TiKVInstance) LogFile ¶ added in v1.0.7
func (inst *TiKVInstance) LogFile() string
LogFile return the log file name.
func (*TiKVInstance) Start ¶
func (inst *TiKVInstance) Start(ctx context.Context, version v0manifest.Version) error
Start calls set inst.cmd and Start
func (*TiKVInstance) StatusAddrs ¶ added in v1.0.4
func (inst *TiKVInstance) StatusAddrs() (addrs []string)
func (*TiKVInstance) StoreAddr ¶
func (inst *TiKVInstance) StoreAddr() string
StoreAddr return the store address of TiKV