Documentation ¶
Index ¶
- Constants
- func ExecuteQueriesUsingVtgate(t *testing.T, session *vtgateconn.VTGateSession, query string)
- func GetMasterPosition(t *testing.T, vttablet Vttablet, hostname string) (string, string)
- func NewConnParams(port int, password, socketPath, keyspace string) mysql.ConnParams
- func PanicHandler(t *testing.T)
- func ResetTabletDirectory(tablet Vttablet) error
- func StartMySQL(ctx context.Context, tablet *Vttablet, username string, tmpDirectory string) error
- func StartMySQLAndGetConnection(ctx context.Context, tablet *Vttablet, username string, tmpDirectory string) (*mysql.Conn, error)
- func VerifyLocalMetadata(t *testing.T, tablet *Vttablet, ksName string, shardName string, cell string)
- func VerifyRowsInTablet(t *testing.T, vttablet *Vttablet, ksName string, expectedRows int)
- func VerifyRowsInTabletForTable(t *testing.T, vttablet *Vttablet, ksName string, expectedRows int, ...)
- func WaitForReplicationPos(t *testing.T, tabletA *Vttablet, tabletB *Vttablet, hostname string, ...)
- type Keyspace
- type LocalProcessCluster
- func (cluster *LocalProcessCluster) CtrlCHandler()
- func (cluster *LocalProcessCluster) GetAndReservePort() int
- func (cluster *LocalProcessCluster) GetAndReserveTabletUID() int
- func (cluster LocalProcessCluster) ListBackups(shardKsName string) ([]string, error)
- func (cluster *LocalProcessCluster) NewOrcProcess(configFile string) *VtorcProcess
- func (cluster *LocalProcessCluster) NewVtgateInstance() *VtgateProcess
- func (cluster *LocalProcessCluster) NewVttabletInstance(tabletType string, UID int, cell string) *Vttablet
- func (cluster LocalProcessCluster) RemoveAllBackups(t *testing.T, shardKsName string)
- func (cluster *LocalProcessCluster) RestartVtgate() (err error)
- func (cluster *LocalProcessCluster) SetupCluster(keyspace *Keyspace, shards []Shard) (err error)
- func (cluster *LocalProcessCluster) StartKeyspace(keyspace Keyspace, shardNames []string, replicaCount int, rdonly bool, ...) (err error)
- func (cluster *LocalProcessCluster) StartTopo() (err error)
- func (cluster *LocalProcessCluster) StartUnshardedKeyspace(keyspace Keyspace, replicaCount int, rdonly bool) error
- func (cluster *LocalProcessCluster) StartVtbackup(newInitDBFile string, initalBackup bool, keyspace string, shard string, ...) error
- func (cluster *LocalProcessCluster) StartVtgate() (err error)
- func (cluster *LocalProcessCluster) StartVttablet(tablet *Vttablet, servingStatus string, supportBackup bool, cell string, ...) error
- func (cluster *LocalProcessCluster) StartVtworker(cell string, extraArgs ...string) error
- func (cluster *LocalProcessCluster) Teardown()
- func (cluster LocalProcessCluster) VerifyBackupCount(t *testing.T, shardKsName string, expected int) []string
- func (cluster *LocalProcessCluster) VtprocessInstanceFromVttablet(tablet *Vttablet, shardName string, ksName string) *VttabletProcess
- func (cluster *LocalProcessCluster) WaitForTabletsToHealthyInVtgate() (err error)
- type MysqlctlProcess
- func (mysqlctl *MysqlctlProcess) CleanupFiles(tabletUID int)
- func (mysqlctl *MysqlctlProcess) ExecuteCommandWithOutput(args ...string) (result string, err error)
- func (mysqlctl *MysqlctlProcess) InitDb() (err error)
- func (mysqlctl *MysqlctlProcess) Start() (err error)
- func (mysqlctl *MysqlctlProcess) StartProcess() (*exec.Cmd, error)
- func (mysqlctl *MysqlctlProcess) Stop() (err error)
- func (mysqlctl *MysqlctlProcess) StopProcess() (*exec.Cmd, error)
- type MysqlctldProcess
- type Shard
- type TopoProcess
- func (topo *TopoProcess) IsHealthy() bool
- func (topo *TopoProcess) ManageTopoDir(command string, directory string) (err error)
- func (topo *TopoProcess) Setup(topoFlavor string, cluster *LocalProcessCluster) (err error)
- func (topo *TopoProcess) SetupConsul(cluster *LocalProcessCluster) (err error)
- func (topo *TopoProcess) SetupEtcd() (err error)
- func (topo *TopoProcess) SetupZookeeper(cluster *LocalProcessCluster) (err error)
- func (topo *TopoProcess) TearDown(Cell string, originalVtRoot string, currentRoot string, keepdata bool, ...) error
- type VtbackupProcess
- type VtctlClientProcess
- func (vtctlclient *VtctlClientProcess) ApplyRoutingRules(JSON string) (err error)
- func (vtctlclient *VtctlClientProcess) ApplySchema(Keyspace string, SQL string) (err error)
- func (vtctlclient *VtctlClientProcess) ApplySchemaWithOutput(Keyspace string, SQL string, ddlStrategy string) (result string, err error)
- func (vtctlclient *VtctlClientProcess) ApplyVSchema(Keyspace string, JSON string) (err error)
- func (vtctlclient *VtctlClientProcess) ExecuteCommand(args ...string) (err error)
- func (vtctlclient *VtctlClientProcess) ExecuteCommandWithOutput(args ...string) (result string, err error)
- func (vtctlclient *VtctlClientProcess) InitShardMaster(Keyspace string, Shard string, Cell string, TabletUID int) (err error)
- func (vtctlclient *VtctlClientProcess) InitTablet(tablet *Vttablet, cell string, keyspaceName string, hostname string, ...) error
- func (vtctlclient *VtctlClientProcess) OnlineDDLCancelAllMigrations(Keyspace string) (result string, err error)
- func (vtctlclient *VtctlClientProcess) OnlineDDLCancelMigration(Keyspace, uuid string) (result string, err error)
- func (vtctlclient *VtctlClientProcess) OnlineDDLRetryMigration(Keyspace, uuid string) (result string, err error)
- func (vtctlclient *VtctlClientProcess) OnlineDDLShowRecent(Keyspace string) (result string, err error)
- type VtctlProcess
- type VtctldProcess
- type VtgateProcess
- func (vtgate *VtgateProcess) GetStatusForTabletOfShard(name string, endPointsCount int) bool
- func (vtgate *VtgateProcess) GetVars() (map[string]interface{}, error)
- func (vtgate *VtgateProcess) Setup() (err error)
- func (vtgate *VtgateProcess) TearDown() error
- func (vtgate *VtgateProcess) WaitForStatus() bool
- func (vtgate *VtgateProcess) WaitForStatusOfTabletInShard(name string, endPointsCount int) error
- type VtorcProcess
- type Vttablet
- type VttabletProcess
- func (vttablet *VttabletProcess) CreateDB(keyspace string) error
- func (vttablet *VttabletProcess) GetDBStatus(status string, ksName string) (string, error)
- func (vttablet *VttabletProcess) GetDBVar(varName string, ksName string) (string, error)
- func (vttablet *VttabletProcess) GetStatus() string
- func (vttablet *VttabletProcess) GetStatusDetails() string
- func (vttablet *VttabletProcess) GetTabletStatus() string
- func (vttablet *VttabletProcess) GetVars() map[string]interface{}
- func (vttablet *VttabletProcess) QueryTablet(query string, keyspace string, useDb bool) (*sqltypes.Result, error)
- func (vttablet *VttabletProcess) QueryTabletWithDB(query string, dbname string) (*sqltypes.Result, error)
- func (vttablet *VttabletProcess) Setup() (err error)
- func (vttablet *VttabletProcess) TearDown() error
- func (vttablet *VttabletProcess) WaitForBinLogPlayerCount(expectedCount int) error
- func (vttablet *VttabletProcess) WaitForBinlogServerState(expectedStatus string) error
- func (vttablet *VttabletProcess) WaitForStatus(status string) bool
- func (vttablet *VttabletProcess) WaitForTabletType(expectedType string) error
- func (vttablet *VttabletProcess) WaitForTabletTypes(expectedTypes []string) error
- func (vttablet *VttabletProcess) WaitForTabletTypesForTimeout(expectedTypes []string, timeout time.Duration) error
- type VtworkerProcess
- func (vtworker *VtworkerProcess) ExecuteCommand(args ...string) (err error)
- func (vtworker *VtworkerProcess) ExecuteCommandInBg(args ...string) (*exec.Cmd, error)
- func (vtworker *VtworkerProcess) ExecuteVtworkerCommand(port int, grpcPort int, args ...string) (err error)
- func (vtworker *VtworkerProcess) GetVars() (map[string]interface{}, error)
- func (vtworker *VtworkerProcess) IsHealthy() bool
- func (vtworker *VtworkerProcess) Setup(cell string) (err error)
- func (vtworker *VtworkerProcess) TearDown() error
Constants ¶
const ( DefaultCell = "zone1" DefaultStartPort = 6700 )
DefaultCell : If no cell name is passed, then use following
Variables ¶
This section is empty.
Functions ¶
func ExecuteQueriesUsingVtgate ¶
func ExecuteQueriesUsingVtgate(t *testing.T, session *vtgateconn.VTGateSession, query string)
ExecuteQueriesUsingVtgate sends query to vtgate using vtgate session.
func GetMasterPosition ¶
GetMasterPosition gets the master position of required vttablet
func NewConnParams ¶
func NewConnParams(port int, password, socketPath, keyspace string) mysql.ConnParams
NewConnParams creates ConnParams corresponds to given arguments.
func ResetTabletDirectory ¶
ResetTabletDirectory transitions back to tablet state (i.e. mysql process restarts with cleaned directory and tablet is off)
func StartMySQL ¶
StartMySQL starts mysqlctl process
func StartMySQLAndGetConnection ¶
func StartMySQLAndGetConnection(ctx context.Context, tablet *Vttablet, username string, tmpDirectory string) (*mysql.Conn, error)
StartMySQLAndGetConnection create a connection to tablet mysql
func VerifyLocalMetadata ¶
func VerifyLocalMetadata(t *testing.T, tablet *Vttablet, ksName string, shardName string, cell string)
VerifyLocalMetadata Verify Local Metadata of a tablet
func VerifyRowsInTablet ¶
VerifyRowsInTablet Verify total number of rows in a tablet
Types ¶
type LocalProcessCluster ¶
type LocalProcessCluster struct { Keyspaces []Keyspace Cell string BaseTabletUID int Hostname string TopoPort int TmpDirectory string OriginalVTDATAROOT string CurrentVTDATAROOT string ReusingVTDATAROOT bool VtgateMySQLPort int VtgateGrpcPort int VtctldHTTPPort int // standalone executable VtctlclientProcess VtctlClientProcess VtctlProcess VtctlProcess // background executable processes TopoProcess TopoProcess VtctldProcess VtctldProcess VtgateProcess VtgateProcess VtworkerProcess VtworkerProcess VtbackupProcess VtbackupProcess VtorcProcess *VtorcProcess //Extra arguments for vtTablet VtTabletExtraArgs []string //Extra arguments for vtGate VtGateExtraArgs []string VtctldExtraArgs []string EnableSemiSync bool context.Context context.CancelFunc // contains filtered or unexported fields }
LocalProcessCluster Testcases need to use this to iniate a cluster
func NewCluster ¶
func NewCluster(cell string, hostname string) *LocalProcessCluster
NewCluster instantiates a new cluster
func (*LocalProcessCluster) CtrlCHandler ¶
func (cluster *LocalProcessCluster) CtrlCHandler()
CtrlCHandler handles the teardown for the ctrl-c.
func (*LocalProcessCluster) GetAndReservePort ¶
func (cluster *LocalProcessCluster) GetAndReservePort() int
GetAndReservePort gives port for required process
func (*LocalProcessCluster) GetAndReserveTabletUID ¶
func (cluster *LocalProcessCluster) GetAndReserveTabletUID() int
GetAndReserveTabletUID gives tablet uid
func (LocalProcessCluster) ListBackups ¶
func (cluster LocalProcessCluster) ListBackups(shardKsName string) ([]string, error)
ListBackups Lists back preset in shard
func (*LocalProcessCluster) NewOrcProcess ¶ added in v0.8.0
func (cluster *LocalProcessCluster) NewOrcProcess(configFile string) *VtorcProcess
NewOrcProcess creates a new VtorcProcess object
func (*LocalProcessCluster) NewVtgateInstance ¶
func (cluster *LocalProcessCluster) NewVtgateInstance() *VtgateProcess
NewVtgateInstance returns an instance of vtgateprocess
func (*LocalProcessCluster) NewVttabletInstance ¶
func (cluster *LocalProcessCluster) NewVttabletInstance(tabletType string, UID int, cell string) *Vttablet
NewVttabletInstance creates a new vttablet object
func (LocalProcessCluster) RemoveAllBackups ¶
func (cluster LocalProcessCluster) RemoveAllBackups(t *testing.T, shardKsName string)
RemoveAllBackups removes all the backup corresponds to list backup.
func (*LocalProcessCluster) RestartVtgate ¶
func (cluster *LocalProcessCluster) RestartVtgate() (err error)
RestartVtgate starts vtgate with updated configs
func (*LocalProcessCluster) SetupCluster ¶ added in v0.8.0
func (cluster *LocalProcessCluster) SetupCluster(keyspace *Keyspace, shards []Shard) (err error)
SetupCluster creates the skeleton for a cluster by creating keyspace shards and initializing tablets and mysqlctl processes. This does not start any process and user have to explicitly start all the required services (ex topo, vtgate, mysql and vttablet)
func (*LocalProcessCluster) StartKeyspace ¶
func (cluster *LocalProcessCluster) StartKeyspace(keyspace Keyspace, shardNames []string, replicaCount int, rdonly bool, customizers ...interface{}) (err error)
StartKeyspace starts required number of shard and the corresponding tablets keyspace : struct containing keyspace name, Sqlschema to apply, VSchema to apply shardName : list of shard names replicaCount: total number of replicas excluding master and rdonly rdonly: whether readonly tablets needed customizers: functions like "func(*VttabletProcess)" that can modify settings of various objects after they're created.
func (*LocalProcessCluster) StartTopo ¶
func (cluster *LocalProcessCluster) StartTopo() (err error)
StartTopo starts topology server
func (*LocalProcessCluster) StartUnshardedKeyspace ¶
func (cluster *LocalProcessCluster) StartUnshardedKeyspace(keyspace Keyspace, replicaCount int, rdonly bool) error
StartUnshardedKeyspace starts unshared keyspace with shard name as "0"
func (*LocalProcessCluster) StartVtbackup ¶
func (cluster *LocalProcessCluster) StartVtbackup(newInitDBFile string, initalBackup bool, keyspace string, shard string, cell string, extraArgs ...string) error
StartVtbackup starts a vtbackup
func (*LocalProcessCluster) StartVtgate ¶
func (cluster *LocalProcessCluster) StartVtgate() (err error)
StartVtgate starts vtgate
func (*LocalProcessCluster) StartVttablet ¶
func (cluster *LocalProcessCluster) StartVttablet(tablet *Vttablet, servingStatus string, supportBackup bool, cell string, keyspaceName string, hostname string, shardName string) error
StartVttablet starts a new tablet
func (*LocalProcessCluster) StartVtworker ¶
func (cluster *LocalProcessCluster) StartVtworker(cell string, extraArgs ...string) error
StartVtworker starts a vtworker
func (*LocalProcessCluster) Teardown ¶
func (cluster *LocalProcessCluster) Teardown()
Teardown brings down the cluster by invoking teardown for individual processes
func (LocalProcessCluster) VerifyBackupCount ¶
func (cluster LocalProcessCluster) VerifyBackupCount(t *testing.T, shardKsName string, expected int) []string
VerifyBackupCount compares the backup count with expected count.
func (*LocalProcessCluster) VtprocessInstanceFromVttablet ¶
func (cluster *LocalProcessCluster) VtprocessInstanceFromVttablet(tablet *Vttablet, shardName string, ksName string) *VttabletProcess
VtprocessInstanceFromVttablet creates a new vttablet object
func (*LocalProcessCluster) WaitForTabletsToHealthyInVtgate ¶
func (cluster *LocalProcessCluster) WaitForTabletsToHealthyInVtgate() (err error)
WaitForTabletsToHealthyInVtgate waits for all tablets in all shards to be healthy as per vtgate
type MysqlctlProcess ¶
type MysqlctlProcess struct { Name string Binary string LogDirectory string TabletUID int MySQLPort int InitDBFile string ExtraArgs []string InitMysql bool SecureTransport bool }
MysqlctlProcess is a generic handle for a running mysqlctl command . It can be spawned manually
func MysqlCtlProcessInstance ¶
func MysqlCtlProcessInstance(tabletUID int, mySQLPort int, tmpDirectory string) *MysqlctlProcess
MysqlCtlProcessInstance returns a Mysqlctl handle for mysqlctl process configured with the given Config.
func MysqlCtlProcessInstanceOptionalInit ¶ added in v0.9.0
func MysqlCtlProcessInstanceOptionalInit(tabletUID int, mySQLPort int, tmpDirectory string, initMySQL bool) *MysqlctlProcess
MysqlCtlProcessInstanceOptionalInit returns a Mysqlctl handle for mysqlctl process configured with the given Config.
func (*MysqlctlProcess) CleanupFiles ¶
func (mysqlctl *MysqlctlProcess) CleanupFiles(tabletUID int)
CleanupFiles clean the mysql files to make sure we can start the same process again
func (*MysqlctlProcess) ExecuteCommandWithOutput ¶
func (mysqlctl *MysqlctlProcess) ExecuteCommandWithOutput(args ...string) (result string, err error)
ExecuteCommandWithOutput executes any mysqlctl command and returns output
func (*MysqlctlProcess) InitDb ¶
func (mysqlctl *MysqlctlProcess) InitDb() (err error)
InitDb executes mysqlctl command to add cell info
func (*MysqlctlProcess) Start ¶
func (mysqlctl *MysqlctlProcess) Start() (err error)
Start executes mysqlctl command to start mysql instance
func (*MysqlctlProcess) StartProcess ¶
func (mysqlctl *MysqlctlProcess) StartProcess() (*exec.Cmd, error)
StartProcess starts the mysqlctl and returns the process reference
func (*MysqlctlProcess) Stop ¶
func (mysqlctl *MysqlctlProcess) Stop() (err error)
Stop executes mysqlctl command to stop mysql instance
func (*MysqlctlProcess) StopProcess ¶
func (mysqlctl *MysqlctlProcess) StopProcess() (*exec.Cmd, error)
StopProcess executes mysqlctl command to stop mysql instance and returns process reference
type MysqlctldProcess ¶
type MysqlctldProcess struct { Name string Binary string LogDirectory string Password string TabletUID int MySQLPort int InitDBFile string ExtraArgs []string InitMysql bool // contains filtered or unexported fields }
MysqlctldProcess is a generic handle for a running mysqlctld command . It can be spawned manually
func MysqlCtldProcessInstance ¶
func MysqlCtldProcessInstance(tabletUID int, mySQLPort int, tmpDirectory string) *MysqlctldProcess
MysqlCtldProcessInstance returns a Mysqlctld handle for mysqlctld process configured with the given Config.
func (*MysqlctldProcess) CleanupFiles ¶
func (mysqlctld *MysqlctldProcess) CleanupFiles(tabletUID int)
CleanupFiles clean the mysql files to make sure we can start the same process again
func (*MysqlctldProcess) InitDb ¶
func (mysqlctld *MysqlctldProcess) InitDb() (err error)
InitDb executes mysqlctld command to add cell info
func (*MysqlctldProcess) IsHealthy ¶
func (mysqlctld *MysqlctldProcess) IsHealthy() bool
IsHealthy gives the health status of mysql.
func (*MysqlctldProcess) Start ¶
func (mysqlctld *MysqlctldProcess) Start() error
Start starts the mysqlctld and returns the error.
func (*MysqlctldProcess) Stop ¶
func (mysqlctld *MysqlctldProcess) Stop() error
Stop executes mysqlctld command to stop mysql instance
type Shard ¶
Shard with associated vttablets
func (*Shard) MasterTablet ¶
MasterTablet get the 1st tablet which is master
type TopoProcess ¶
type TopoProcess struct { Name string Binary string DataDirectory string LogDirectory string ListenClientURL string AdvertiseClientURL string Port int Host string VerifyURL string PeerURL string ZKPorts string // contains filtered or unexported fields }
TopoProcess is a generic handle for a running Topo service . It can be spawned manually
func TopoProcessInstance ¶
func TopoProcessInstance(port int, peerPort int, hostname string, flavor string, name string) *TopoProcess
TopoProcessInstance returns a TopoProcess handle for a etcd sevice, configured with the given Config. The process must be manually started by calling setup()
func (*TopoProcess) IsHealthy ¶
func (topo *TopoProcess) IsHealthy() bool
IsHealthy function checks if topo server is up and running
func (*TopoProcess) ManageTopoDir ¶
func (topo *TopoProcess) ManageTopoDir(command string, directory string) (err error)
ManageTopoDir creates global and zone in etcd2
func (*TopoProcess) Setup ¶
func (topo *TopoProcess) Setup(topoFlavor string, cluster *LocalProcessCluster) (err error)
Setup starts a new topo service
func (*TopoProcess) SetupConsul ¶
func (topo *TopoProcess) SetupConsul(cluster *LocalProcessCluster) (err error)
SetupConsul spawns a new consul service and initializes it with the defaults. The service is kept running in the background until TearDown() is called.
func (*TopoProcess) SetupEtcd ¶
func (topo *TopoProcess) SetupEtcd() (err error)
SetupEtcd spawns a new etcd service and initializes it with the defaults. The service is kept running in the background until TearDown() is called.
func (*TopoProcess) SetupZookeeper ¶
func (topo *TopoProcess) SetupZookeeper(cluster *LocalProcessCluster) (err error)
SetupZookeeper spawns a new zookeeper topo service and initializes it with the defaults. The service is kept running in the background until TearDown() is called.
type VtbackupProcess ¶
type VtbackupProcess struct { Name string Binary string CommonArg VtctlProcess LogDir string MysqlPort int Directory string Cell string Keyspace string Shard string TabletAlias string Server string ExtraArgs []string // contains filtered or unexported fields }
VtbackupProcess is a generic handle for a running Vtbackup. It can be spawned manually
func VtbackupProcessInstance ¶
func VtbackupProcessInstance(tabletUID int, mysqlPort int, newInitDBFile string, keyspace string, shard string, cell string, hostname string, tmpDirectory string, topoPort int, initialBackup bool) *VtbackupProcess
VtbackupProcessInstance returns a vtbackup handle configured with the given Config. The process must be manually started by calling Setup()
func (*VtbackupProcess) Setup ¶
func (vtbackup *VtbackupProcess) Setup() (err error)
Setup starts vtbackup process with required arguements
func (*VtbackupProcess) TearDown ¶
func (vtbackup *VtbackupProcess) TearDown() error
TearDown shutdowns the running vtbackup process
type VtctlClientProcess ¶
type VtctlClientProcess struct { Name string Binary string Server string TempDirectory string ZoneName string }
VtctlClientProcess is a generic handle for a running vtctlclient command . It can be spawned manually
func VtctlClientProcessInstance ¶
func VtctlClientProcessInstance(hostname string, grpcPort int, tmpDirectory string) *VtctlClientProcess
VtctlClientProcessInstance returns a VtctlProcess handle for vtctlclient process configured with the given Config.
func (*VtctlClientProcess) ApplyRoutingRules ¶ added in v0.9.0
func (vtctlclient *VtctlClientProcess) ApplyRoutingRules(JSON string) (err error)
ApplyRoutingRules does it
func (*VtctlClientProcess) ApplySchema ¶
func (vtctlclient *VtctlClientProcess) ApplySchema(Keyspace string, SQL string) (err error)
ApplySchema applies SQL schema to the keyspace
func (*VtctlClientProcess) ApplySchemaWithOutput ¶ added in v0.8.0
func (vtctlclient *VtctlClientProcess) ApplySchemaWithOutput(Keyspace string, SQL string, ddlStrategy string) (result string, err error)
ApplySchemaWithOutput applies SQL schema to the keyspace
func (*VtctlClientProcess) ApplyVSchema ¶
func (vtctlclient *VtctlClientProcess) ApplyVSchema(Keyspace string, JSON string) (err error)
ApplyVSchema applies vitess schema (JSON format) to the keyspace
func (*VtctlClientProcess) ExecuteCommand ¶
func (vtctlclient *VtctlClientProcess) ExecuteCommand(args ...string) (err error)
ExecuteCommand executes any vtctlclient command
func (*VtctlClientProcess) ExecuteCommandWithOutput ¶
func (vtctlclient *VtctlClientProcess) ExecuteCommandWithOutput(args ...string) (result string, err error)
ExecuteCommandWithOutput executes any vtctlclient command and returns output
func (*VtctlClientProcess) InitShardMaster ¶
func (vtctlclient *VtctlClientProcess) InitShardMaster(Keyspace string, Shard string, Cell string, TabletUID int) (err error)
InitShardMaster executes vtctlclient command to make one of tablet as master
func (*VtctlClientProcess) InitTablet ¶
func (vtctlclient *VtctlClientProcess) InitTablet(tablet *Vttablet, cell string, keyspaceName string, hostname string, shardName string) error
InitTablet initializes a tablet
func (*VtctlClientProcess) OnlineDDLCancelAllMigrations ¶ added in v0.9.0
func (vtctlclient *VtctlClientProcess) OnlineDDLCancelAllMigrations(Keyspace string) (result string, err error)
OnlineDDLCancelAllMigrations cancels all migrations for a keyspace
func (*VtctlClientProcess) OnlineDDLCancelMigration ¶ added in v0.8.0
func (vtctlclient *VtctlClientProcess) OnlineDDLCancelMigration(Keyspace, uuid string) (result string, err error)
OnlineDDLCancelMigration cancels a given migration uuid
func (*VtctlClientProcess) OnlineDDLRetryMigration ¶ added in v0.8.0
func (vtctlclient *VtctlClientProcess) OnlineDDLRetryMigration(Keyspace, uuid string) (result string, err error)
OnlineDDLRetryMigration retries a given migration uuid
func (*VtctlClientProcess) OnlineDDLShowRecent ¶ added in v0.8.0
func (vtctlclient *VtctlClientProcess) OnlineDDLShowRecent(Keyspace string) (result string, err error)
OnlineDDLShowRecent responds with recent schema migration list
type VtctlProcess ¶
type VtctlProcess struct { Name string Binary string TopoImplementation string TopoGlobalAddress string TopoGlobalRoot string TopoServerAddress string TopoRootPath string }
VtctlProcess is a generic handle for a running vtctl command . It can be spawned manually
func VtctlProcessInstance ¶
func VtctlProcessInstance(topoPort int, hostname string) *VtctlProcess
VtctlProcessInstance returns a VtctlProcess handle for vtctl process configured with the given Config. The process must be manually started by calling setup()
func (*VtctlProcess) AddCellInfo ¶
func (vtctl *VtctlProcess) AddCellInfo(Cell string) (err error)
AddCellInfo executes vtctl command to add cell info
func (*VtctlProcess) CreateKeyspace ¶
func (vtctl *VtctlProcess) CreateKeyspace(keyspace string) (err error)
CreateKeyspace executes vtctl command to create keyspace
func (*VtctlProcess) ExecuteCommand ¶
func (vtctl *VtctlProcess) ExecuteCommand(args ...string) (err error)
ExecuteCommand executes any vtctlclient command
func (*VtctlProcess) ExecuteCommandWithOutput ¶
func (vtctl *VtctlProcess) ExecuteCommandWithOutput(args ...string) (result string, err error)
ExecuteCommandWithOutput executes any vtctlclient command and returns output
type VtctldProcess ¶
type VtctldProcess struct { Name string Binary string CommonArg VtctlProcess ServiceMap string BackupStorageImplementation string FileBackupStorageRoot string LogDir string Port int GrpcPort int VerifyURL string Directory string // contains filtered or unexported fields }
VtctldProcess is a generic handle for a running vtctld . It can be spawned manually
func VtctldProcessInstance ¶
func VtctldProcessInstance(httpPort int, grpcPort int, topoPort int, hostname string, tmpDirectory string) *VtctldProcess
VtctldProcessInstance returns a VtctlProcess handle for vtctl process configured with the given Config. The process must be manually started by calling setup()
func (*VtctldProcess) IsHealthy ¶
func (vtctld *VtctldProcess) IsHealthy() bool
IsHealthy function checks if vtctld process is up and running
func (*VtctldProcess) Setup ¶
func (vtctld *VtctldProcess) Setup(cell string, extraArgs ...string) (err error)
Setup starts vtctld process with required arguements
func (*VtctldProcess) TearDown ¶
func (vtctld *VtctldProcess) TearDown() error
TearDown shutdowns the running vtctld service
type VtgateProcess ¶
type VtgateProcess struct { Name string Binary string CommonArg VtctlProcess LogDir string FileToLogQueries string Port int GrpcPort int MySQLServerPort int MySQLServerSocketPath string Cell string CellsToWatch string TabletTypesToWait string GatewayImplementation string ServiceMap string MySQLAuthServerImpl string Directory string VerifyURL string SysVarSetEnabled bool //Extra Args to be set before starting the vtgate process ExtraArgs []string // contains filtered or unexported fields }
VtgateProcess is a generic handle for a running vtgate . It can be spawned manually
func VtgateProcessInstance ¶
func VtgateProcessInstance(port int, grpcPort int, mySQLServerPort int, cell string, cellsToWatch string, hostname string, tabletTypesToWait string, topoPort int, tmpDirectory string, extraArgs []string) *VtgateProcess
VtgateProcessInstance returns a Vtgate handle for vtgate process configured with the given Config. The process must be manually started by calling setup()
func (*VtgateProcess) GetStatusForTabletOfShard ¶
func (vtgate *VtgateProcess) GetStatusForTabletOfShard(name string, endPointsCount int) bool
GetStatusForTabletOfShard function gets status for a specific tablet of a shard in keyspace endPointsCount : number of endpoints
func (*VtgateProcess) GetVars ¶
func (vtgate *VtgateProcess) GetVars() (map[string]interface{}, error)
GetVars returns map of vars
func (*VtgateProcess) Setup ¶
func (vtgate *VtgateProcess) Setup() (err error)
Setup starts Vtgate process with required arguements
func (*VtgateProcess) TearDown ¶
func (vtgate *VtgateProcess) TearDown() error
TearDown shuts down the running vtgate service
func (*VtgateProcess) WaitForStatus ¶
func (vtgate *VtgateProcess) WaitForStatus() bool
WaitForStatus function checks if vtgate process is up and running
func (*VtgateProcess) WaitForStatusOfTabletInShard ¶
func (vtgate *VtgateProcess) WaitForStatusOfTabletInShard(name string, endPointsCount int) error
WaitForStatusOfTabletInShard function waits till status of a tablet in shard is 1 endPointsCount: how many endpoints to wait for
type VtorcProcess ¶ added in v0.8.0
type VtorcProcess struct { VtctlProcess LogDir string ExtraArgs []string Config string // contains filtered or unexported fields }
VtorcProcess is a test struct for running vtorc as a separate process for testing
func (*VtorcProcess) Setup ¶ added in v0.8.0
func (orc *VtorcProcess) Setup() (err error)
Setup starts orc process with required arguements
func (*VtorcProcess) TearDown ¶ added in v0.8.0
func (orc *VtorcProcess) TearDown() error
TearDown shuts down the running vtorc service
type Vttablet ¶
type Vttablet struct { Type string TabletUID int HTTPPort int GrpcPort int MySQLPort int Alias string Cell string // background executable processes MysqlctlProcess MysqlctlProcess MysqlctldProcess MysqlctldProcess VttabletProcess *VttabletProcess }
Vttablet stores the properties needed to start a vttablet process
func (*Vttablet) ValidateTabletRestart ¶
ValidateTabletRestart restarts the tablet and validate error if there is any.
type VttabletProcess ¶
type VttabletProcess struct { Name string Binary string FileToLogQueries string TabletUID int TabletPath string Cell string Port int GrpcPort int Shard string CommonArg VtctlProcess LogDir string TabletHostname string Keyspace string TabletType string HealthCheckInterval int BackupStorageImplementation string FileBackupStorageRoot string ServiceMap string VtctldAddress string Directory string VerifyURL string QueryzURL string StatusDetailsURL string EnableSemiSync bool SupportsBackup bool ServingStatus string DbPassword string DbPort int VreplicationTabletType string //Extra Args to be set before starting the vttablet process ExtraArgs []string // contains filtered or unexported fields }
VttabletProcess is a generic handle for a running vttablet . It can be spawned manually
func VttabletProcessInstance ¶
func VttabletProcessInstance(port int, grpcPort int, tabletUID int, cell string, shard string, keyspace string, vtctldPort int, tabletType string, topoPort int, hostname string, tmpDirectory string, extraArgs []string, enableSemiSync bool) *VttabletProcess
VttabletProcessInstance returns a VttabletProcess handle for vttablet process configured with the given Config. The process must be manually started by calling setup()
func (*VttabletProcess) CreateDB ¶
func (vttablet *VttabletProcess) CreateDB(keyspace string) error
CreateDB creates the database for keyspace
func (*VttabletProcess) GetDBStatus ¶
func (vttablet *VttabletProcess) GetDBStatus(status string, ksName string) (string, error)
GetDBStatus returns first matching database variable's value
func (*VttabletProcess) GetDBVar ¶
func (vttablet *VttabletProcess) GetDBVar(varName string, ksName string) (string, error)
GetDBVar returns first matching database variable's value
func (*VttabletProcess) GetStatus ¶
func (vttablet *VttabletProcess) GetStatus() string
GetStatus returns /debug/status endpoint result
func (*VttabletProcess) GetStatusDetails ¶
func (vttablet *VttabletProcess) GetStatusDetails() string
GetStatusDetails gets the status details
func (*VttabletProcess) GetTabletStatus ¶
func (vttablet *VttabletProcess) GetTabletStatus() string
GetTabletStatus returns the tablet state as seen in /debug/vars TabletStateName
func (*VttabletProcess) GetVars ¶
func (vttablet *VttabletProcess) GetVars() map[string]interface{}
GetVars gets the debug vars as map
func (*VttabletProcess) QueryTablet ¶
func (vttablet *VttabletProcess) QueryTablet(query string, keyspace string, useDb bool) (*sqltypes.Result, error)
QueryTablet lets you execute a query in this tablet and get the result
func (*VttabletProcess) QueryTabletWithDB ¶
func (vttablet *VttabletProcess) QueryTabletWithDB(query string, dbname string) (*sqltypes.Result, error)
QueryTabletWithDB lets you execute query on a specific DB in this tablet and get the result
func (*VttabletProcess) Setup ¶
func (vttablet *VttabletProcess) Setup() (err error)
Setup starts vttablet process with required arguements
func (*VttabletProcess) TearDown ¶
func (vttablet *VttabletProcess) TearDown() error
TearDown shuts down the running vttablet service
func (*VttabletProcess) WaitForBinLogPlayerCount ¶
func (vttablet *VttabletProcess) WaitForBinLogPlayerCount(expectedCount int) error
WaitForBinLogPlayerCount waits till binlog player count var matches
func (*VttabletProcess) WaitForBinlogServerState ¶
func (vttablet *VttabletProcess) WaitForBinlogServerState(expectedStatus string) error
WaitForBinlogServerState wait for the tablet's binlog server to be in the provided state.
func (*VttabletProcess) WaitForStatus ¶
func (vttablet *VttabletProcess) WaitForStatus(status string) bool
WaitForStatus waits till desired status of tablet is reached
func (*VttabletProcess) WaitForTabletType ¶
func (vttablet *VttabletProcess) WaitForTabletType(expectedType string) error
WaitForTabletType waits for 10 second till expected type reached
func (*VttabletProcess) WaitForTabletTypes ¶
func (vttablet *VttabletProcess) WaitForTabletTypes(expectedTypes []string) error
WaitForTabletTypes waits for 10 second till expected type reached
func (*VttabletProcess) WaitForTabletTypesForTimeout ¶
func (vttablet *VttabletProcess) WaitForTabletTypesForTimeout(expectedTypes []string, timeout time.Duration) error
WaitForTabletTypesForTimeout waits till the tablet reaches to any of the provided status
type VtworkerProcess ¶
type VtworkerProcess struct { Name string Binary string CommonArg VtctlProcess ServiceMap string LogDir string Port int GrpcPort int VerifyURL string Directory string ExecuteRetryTime string Cell string Server string CommandDisplayInterval string ExtraArgs []string // contains filtered or unexported fields }
VtworkerProcess is a generic handle for a running vtworker . It can be spawned manually
func VtworkerProcessInstance ¶
func VtworkerProcessInstance(httpPort int, grpcPort int, topoPort int, hostname string, tmpDirectory string) *VtworkerProcess
VtworkerProcessInstance returns a vtworker handle configured with the given Config. The process must be manually started by calling Setup()
func (*VtworkerProcess) ExecuteCommand ¶
func (vtworker *VtworkerProcess) ExecuteCommand(args ...string) (err error)
ExecuteCommand executes any vtworker command
func (*VtworkerProcess) ExecuteCommandInBg ¶
func (vtworker *VtworkerProcess) ExecuteCommandInBg(args ...string) (*exec.Cmd, error)
func (*VtworkerProcess) ExecuteVtworkerCommand ¶
func (vtworker *VtworkerProcess) ExecuteVtworkerCommand(port int, grpcPort int, args ...string) (err error)
ExecuteVtworkerCommand executes any vtworker command
func (*VtworkerProcess) GetVars ¶
func (vtworker *VtworkerProcess) GetVars() (map[string]interface{}, error)
GetVars returns map of vars
func (*VtworkerProcess) IsHealthy ¶
func (vtworker *VtworkerProcess) IsHealthy() bool
IsHealthy function checks if vtworker process is up and running
func (*VtworkerProcess) Setup ¶
func (vtworker *VtworkerProcess) Setup(cell string) (err error)
Setup starts vtworker process with required arguements
func (*VtworkerProcess) TearDown ¶
func (vtworker *VtworkerProcess) TearDown() error
TearDown shutdowns the running vtworker process