vitesstopo

package
v0.0.0-...-5d90d19 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CellsToPrune

func CellsToPrune(cellNames []string, desiredCells map[string]*planetscalev2.LockserverSpec, orphanedCells map[string]planetscalev2.OrphanStatus) []string

CellsToPrune returns a list of cell candidates for pruning, based on a provided list of cells to consider.

func DeleteCells

func DeleteCells(ctx context.Context, ts *topo.Server, recorder record.EventRecorder, eventObj runtime.Object, cellNames []string) (reconcile.Result, error)

DeleteCells takes in a list of cell names and deletes their CellInfo records from topology.

func DeleteKeyspaces

func DeleteKeyspaces(ctx context.Context, ts *topo.Server, recorder record.EventRecorder, eventObj runtime.Object, keyspaceNames []string) (reconcile.Result, error)

DeleteKeyspaces takes in a list of keyspace names and deletes their records from topology.

func DeleteShards

func DeleteShards(ctx context.Context, ts *topo.Server, recorder record.EventRecorder, eventObj runtime.Object, keyspaceName string, shardNames []string) (reconcile.Result, error)

DeleteShards takes in a list of shard names and deletes their records from topology.

func KeyspacesToPrune

func KeyspacesToPrune(keyspaceNames []string, desiredKeyspaces sets.String, orphanedKeyspaces map[string]planetscalev2.OrphanStatus) []string

KeyspacesToPrune returns a list of keyspace candidates for pruning, based on a provided list of keyspaces to consider.

func PruneCells

func PruneCells(ctx context.Context, p PruneCellsParams) (reconcile.Result, error)

PruneCells will prune cells that exist but shouldn't anymore.

func PruneKeyspaces

func PruneKeyspaces(ctx context.Context, p PruneKeyspacesParams) (reconcile.Result, error)

PruneKeyspaces will prune keyspaces that exist but shouldn't anymore.

func PruneShards

func PruneShards(ctx context.Context, p PruneShardsParams) (reconcile.Result, error)

PruneShards will prune shards that exist but shouldn't anymore.

func ShardsToPrune

func ShardsToPrune(currentShards []string, desiredShards sets.String, orphanedShards map[string]planetscalev2.OrphanStatus) []string

ShardsToPrune returns a list of shard candidates for pruning, based on a provided list of shards to consider.

Types

type PruneCellsParams

type PruneCellsParams struct {
	// EventObj holds the object type that the recorder will use when writing events.
	EventObj   runtime.Object
	TopoServer *topo.Server
	Recorder   record.EventRecorder
	// DesiredCells is a map of cell names to their lockserver specs.
	DesiredCells map[string]*planetscalev2.LockserverSpec
	// OrphanedCells is a list of unwanted cells that could not be turned down.
	OrphanedCells map[string]planetscalev2.OrphanStatus
}

type PruneKeyspacesParams

type PruneKeyspacesParams struct {
	// EventObj holds the object type that the recorder will use when writing events.
	EventObj   runtime.Object
	TopoServer *topo.Server
	Recorder   record.EventRecorder
	// Keyspaces is a current list of KeySpaceTemplates from the cluster spec.
	Keyspaces []planetscalev2.VitessKeyspaceTemplate
	// OrphanedKeyspaces is a list of unwanted keyspaces that could not be turned down.
	OrphanedKeyspaces map[string]planetscalev2.OrphanStatus
}

type PruneShardsParams

type PruneShardsParams struct {
	// EventObj holds the object type that the recorder will use when writing events.
	EventObj     runtime.Object
	TopoServer   *topo.Server
	Recorder     record.EventRecorder
	KeyspaceName string
	// DesiredShards is a set of currently desired shard names, usually pulled from the keyspace spec.
	DesiredShards sets.String
	// OrphanedShards is a list of unwanted shards that could not be turned down.
	OrphanedShards map[string]planetscalev2.OrphanStatus
}

type RegisterCellsParams

type RegisterCellsParams struct {
	// EventObj holds the object type that the recorder will use when writing events.
	EventObj         runtime.Object
	TopoServer       *topo.Server
	Recorder         record.EventRecorder
	GlobalLockserver *planetscalev2.LockserverSpec
	ClusterName      string
	GlobalTopoImpl   string
	// DesiredCells is a map of cell names to their lockserver specs.
	DesiredCells map[string]*planetscalev2.LockserverSpec
}

Jump to

Keyboard shortcuts

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