vreplication

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

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 Keyspace

type Keyspace struct {
	Name    string
	Shards  map[string]*Shard
	VSchema string
	Schema  string
}

Keyspace represents a Vitess keyspace contained by a cell within the test cluster

type Shard

type Shard struct {
	Name      string
	IsSharded bool
	Tablets   map[string]*Tablet
}

Shard represents a Vitess shard in a keyspace

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 {
	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 InitCluster

func InitCluster(t *testing.T, cellNames []string) *VitessCluster

InitCluster creates the global processes needed for a cluster

func NewVitessCluster

func NewVitessCluster(name string) (cluster *VitessCluster, err error)

NewVitessCluster creates an entire VitessCluster for e2e testing

func (*VitessCluster) AddCell

func (vc *VitessCluster) AddCell(t *testing.T, name string) (*Cell, error)

AddCell adds a new cell to the cluster

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL