Documentation ¶
Index ¶
- type Cell
- type ClusterConfig
- type Keyspace
- type Shard
- type Tablet
- type VitessCluster
- func (vc *VitessCluster) AddCell(t *testing.T, name string) (*Cell, error)
- func (vc *VitessCluster) AddKeyspace(t *testing.T, cells []*Cell, ksName string, shards string, vschema string, ...) (*Keyspace, error)
- func (vc *VitessCluster) AddShards(t *testing.T, cells []*Cell, keyspace *Keyspace, names string, numReplicas int, ...) error
- func (vc *VitessCluster) AddTablet(t *testing.T, cell *Cell, keyspace *Keyspace, shard *Shard, tabletType string, ...) (*Tablet, *exec.Cmd, error)
- func (vc *VitessCluster) DeleteShard(t *testing.T, cellName string, ksName string, shardName string)
- func (vc *VitessCluster) StartVtgate(t *testing.T, cell *Cell, cellsToWatch string)
- func (vc *VitessCluster) TearDown()
- func (vc *VitessCluster) WaitForVReplicationToCatchup(vttablet *cluster.VttabletProcess, workflow string, database string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cell ¶
type Cell struct { Name string Keyspaces map[string]*Keyspace Vtgates []*cluster.VtgateProcess }
Cell represents a Vitess cell within the test cluster
type ClusterConfig ¶ added in v0.10.0
type ClusterConfig struct {
// contains filtered or unexported fields
}
ClusterConfig defines the parameters like ports, tmpDir, tablet types which uniquely define a vitess cluster
type Tablet ¶
type Tablet struct { Name string Vttablet *cluster.VttabletProcess DbServer *cluster.MysqlctlProcess }
Tablet represents a vttablet within a shard
type VitessCluster ¶
type VitessCluster struct { ClusterConfig *ClusterConfig Name string Cells map[string]*Cell Topo *cluster.TopoProcess Vtctld *cluster.VtctldProcess Vtctl *cluster.VtctlProcess VtctlClient *cluster.VtctlClientProcess }
VitessCluster represents all components within the test cluster
func NewVitessCluster ¶
func NewVitessCluster(t *testing.T, name string, cellNames []string, clusterConfig *ClusterConfig) *VitessCluster
NewVitessCluster starts a basic cluster with vtgate, vtctld and the topo
func (*VitessCluster) AddKeyspace ¶
func (vc *VitessCluster) AddKeyspace(t *testing.T, cells []*Cell, ksName string, shards string, vschema string, schema string, numReplicas int, numRdonly int, tabletIDBase int) (*Keyspace, error)
AddKeyspace creates a keyspace with specified shard keys and number of replica/read-only tablets
func (*VitessCluster) AddShards ¶
func (vc *VitessCluster) AddShards(t *testing.T, cells []*Cell, keyspace *Keyspace, names string, numReplicas int, numRdonly int, tabletIDBase int) error
AddShards creates shards given list of comma-separated keys with specified tablets in each shard
func (*VitessCluster) AddTablet ¶
func (vc *VitessCluster) AddTablet(t *testing.T, cell *Cell, keyspace *Keyspace, shard *Shard, tabletType string, tabletID int) (*Tablet, *exec.Cmd, error)
AddTablet creates new tablet with specified attributes
func (*VitessCluster) DeleteShard ¶
func (vc *VitessCluster) DeleteShard(t *testing.T, cellName string, ksName string, shardName string)
DeleteShard deletes a shard
func (*VitessCluster) StartVtgate ¶
func (vc *VitessCluster) StartVtgate(t *testing.T, cell *Cell, cellsToWatch string)
StartVtgate starts a vtgate process
func (*VitessCluster) TearDown ¶
func (vc *VitessCluster) TearDown()
TearDown brings down a cluster, deleting processes, removing topo keys
func (*VitessCluster) WaitForVReplicationToCatchup ¶
func (vc *VitessCluster) WaitForVReplicationToCatchup(vttablet *cluster.VttabletProcess, workflow string, database string, duration time.Duration) error
WaitForVReplicationToCatchup waits for "workflow" to finish copying