vreplication

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 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 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 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 {
	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) 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