cmd

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DumplingCsvOutputDialectMap = map[string]export.CSVDialect{
	"":          export.CSVDialectDefault,
	"default":   export.CSVDialectDefault,
	"bigquery":  export.CSVDialectBigQuery,
	"snowflake": export.CSVDialectSnowflake,
	"redshift":  export.CSVDialectRedshift,
}
View Source
var RunModeIds = map[RunMode][]string{
	RunModeFull:            {"full"},
	RunModeSnapshotOnly:    {"snapshot-only"},
	RunModeIncrementalOnly: {"incremental-only"},
	RunModeCloud:           {"cloud"},
}

Functions

func Export

func Export(
	ctx context.Context,
	tidbConfig *tidbsql.TiDBConfig,
	tables []string,
	storageURI *url.URL,
	snapshotURI *url.URL,
	incrementURI *url.URL,
	snapshotConcurrency int,
	cdcHost string,
	cdcPort int,
	cdcFlushInterval time.Duration,
	cdcFileSize int,
	csvOutputDialect string,
	mode RunMode,
) error

func NewBigQueryCmd

func NewBigQueryCmd() *cobra.Command

func NewDatabricksCmd

func NewDatabricksCmd() *cobra.Command

func NewGCSCmd

func NewGCSCmd() *cobra.Command

func NewRedshiftCmd

func NewRedshiftCmd() *cobra.Command

func NewS3Cmd

func NewS3Cmd() *cobra.Command

func NewSnowflakeCmd

func NewSnowflakeCmd() *cobra.Command

func Replicate

func Replicate(
	tidbConfig *tidbsql.TiDBConfig,
	tables []string,
	storageURI *url.URL,
	snapshotURI *url.URL,
	incrementURI *url.URL,
	snapshotConcurrency int,
	cdcHost string,
	cdcPort int,
	cdcFlushInterval time.Duration,
	cdcFileSize int,
	snapConnectorMap map[string]coreinterfaces.Connector,
	increConnectorMap map[string]coreinterfaces.Connector,
	csvOutputDialect string,
	parrallelLoad bool,
	mode RunMode,
) error

Types

type RunMode

type RunMode enumflag.Flag
const (
	RunModeFull RunMode = iota
	RunModeSnapshotOnly
	RunModeIncrementalOnly
	RunModeCloud
)

type Stage

type Stage string

o => create changefeed => dump snapshot => load snapshot => incremental load

^                     ^                    ^ 				 ^
|			          |				       |				 |
+------ init ---------+ changefeed created + snapshot dumped + snapshot loaded --
const (
	StageInit              Stage = "init"
	StageChangefeedCreated Stage = "changefeed-created"
	StageSnapshotDumped    Stage = "snapshot-dumped"
	StageSnapshotLoaded    Stage = "snapshot-loaded"
)

Jump to

Keyboard shortcuts

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