common

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MaxReplicationLagDefault = 30 * time.Second

	BaseOptions = struct {
		Workflow       string
		TargetKeyspace string
		Format         string
	}{}

	CreateOptions = struct {
		Cells                        []string
		AllCells                     bool
		TabletTypes                  []topodatapb.TabletType
		TabletTypesInPreferenceOrder bool
		OnDDL                        string
		DeferSecondaryKeys           bool
		AutoStart                    bool
		StopAfterCopy                bool
		MySQLServerVersion           string
		TruncateUILen                int
		TruncateErrLen               int
		ReferenceTables              []string
		ConfigOverrides              []string
	}{}
)
View Source
var CancelOptions = struct {
	KeepData         bool
	KeepRoutingRules bool
	Shards           []string
}{}
View Source
var CompleteOptions = struct {
	KeepData         bool
	KeepRoutingRules bool
	RenameTables     bool
	DryRun           bool
	Shards           []string
}{}
View Source
var MirrorTrafficOptions = struct {
	DryRun      bool
	Percent     float32
	TabletTypes []topodatapb.TabletType
}{}
View Source
var ShowOptions = struct {
	IncludeLogs bool
	Shards      []string
}{}
View Source
var StatusOptions = struct {
	Shards []string
}{}
View Source
var SwitchTrafficOptions = struct {
	Cells                     []string
	TabletTypes               []topodatapb.TabletType
	Timeout                   time.Duration
	MaxReplicationLagAllowed  time.Duration
	EnableReverseReplication  bool
	DryRun                    bool
	Direction                 workflow.TrafficSwitchDirection
	InitializeTargetSequences bool
	Shards                    []string
	Force                     bool
}{}

Functions

func AddCommonCreateFlags

func AddCommonCreateFlags(cmd *cobra.Command)

func AddCommonFlags

func AddCommonFlags(cmd *cobra.Command)

func AddCommonSwitchTrafficFlags

func AddCommonSwitchTrafficFlags(cmd *cobra.Command, initializeTargetSequences bool)

func AddShardSubsetFlag added in v0.19.0

func AddShardSubsetFlag(cmd *cobra.Command, shardsOption *[]string)

func CanRestartWorkflow

func CanRestartWorkflow(keyspace, workflow string) error

CanRestartWorkflow validates that, for an atomic copy workflow, none of the streams are still in the copy phase. Since we copy all tables in a single snapshot, we cannot restart a workflow which broke before all tables were copied.

func GetCancelCommand

func GetCancelCommand(opts *SubCommandsOpts) *cobra.Command

func GetClient

func GetClient() vtctldclient.VtctldClient

func GetCommandCtx

func GetCommandCtx() context.Context

func GetCompleteCommand

func GetCompleteCommand(opts *SubCommandsOpts) *cobra.Command

func GetMirrorTrafficCommand added in v0.21.0

func GetMirrorTrafficCommand(opts *SubCommandsOpts) *cobra.Command

func GetOutputFormat

func GetOutputFormat(cmd *cobra.Command) (string, error)

func GetReverseTrafficCommand

func GetReverseTrafficCommand(opts *SubCommandsOpts) *cobra.Command

func GetShowCommand

func GetShowCommand(opts *SubCommandsOpts) *cobra.Command

func GetStartCommand

func GetStartCommand(opts *SubCommandsOpts) *cobra.Command

func GetStatusCommand

func GetStatusCommand(opts *SubCommandsOpts) *cobra.Command

func GetStopCommand

func GetStopCommand(opts *SubCommandsOpts) *cobra.Command

func GetSwitchTrafficCommand

func GetSwitchTrafficCommand(opts *SubCommandsOpts) *cobra.Command

func OutputStatusResponse

func OutputStatusResponse(resp *vtctldatapb.WorkflowStatusResponse, format string) error

func ParseAndValidateCreateOptions

func ParseAndValidateCreateOptions(cmd *cobra.Command) error

func ParseCells

func ParseCells(cmd *cobra.Command) error

func ParseConfigOverrides added in v0.21.0

func ParseConfigOverrides(overrides []string) (map[string]string, error)

ParseConfigOverrides converts a slice of key=value strings into a map of config overrides. The slice is passed as a flag to the command, and the key=value pairs are used to override the default vreplication config values.

func ParseTabletTypes

func ParseTabletTypes(cmd *cobra.Command) error

func RegisterCommandHandler

func RegisterCommandHandler(command string, handler func(cmd *cobra.Command))

func RegisterCommands

func RegisterCommands(root *cobra.Command)

func SetClient

func SetClient(c vtctldclient.VtctldClient)

func SetCommandCtx

func SetCommandCtx(ctx context.Context)

func ValidateShards added in v0.21.0

func ValidateShards(shards []string) error

ValidateShards checks if the provided shard names are valid key ranges.

Types

type SubCommandsOpts

type SubCommandsOpts struct {
	SubCommand string
	Workflow   string // Used to specify an example workflow name for the Examples section of the help output.
}

Jump to

Keyboard shortcuts

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