glue

package
v5.1.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: Apache-2.0 Imports: 13 Imported by: 36

Documentation

Index

Constants

View Source
const (
	RecordEstimatedChunk = "EstimatedChunk"
	RecordFinishedChunk  = "FinishedChunk"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ExternalTiDBGlue

type ExternalTiDBGlue struct {
	// contains filtered or unexported fields
}

func NewExternalTiDBGlue

func NewExternalTiDBGlue(db *sql.DB, sqlMode mysql.SQLMode) *ExternalTiDBGlue

func (*ExternalTiDBGlue) Close

func (e *ExternalTiDBGlue) Close()

func (*ExternalTiDBGlue) ExecuteWithLog

func (e *ExternalTiDBGlue) ExecuteWithLog(ctx context.Context, query string, purpose string, logger log.Logger) error

func (*ExternalTiDBGlue) GetDB

func (e *ExternalTiDBGlue) GetDB() (*sql.DB, error)

func (*ExternalTiDBGlue) GetParser

func (e *ExternalTiDBGlue) GetParser() *parser.Parser

func (*ExternalTiDBGlue) GetSQLExecutor

func (e *ExternalTiDBGlue) GetSQLExecutor() SQLExecutor

func (*ExternalTiDBGlue) GetSession

func (e *ExternalTiDBGlue) GetSession(ctx context.Context) (checkpoints.Session, error)

func (ExternalTiDBGlue) GetTables

func (*ExternalTiDBGlue) ObtainStringWithLog

func (e *ExternalTiDBGlue) ObtainStringWithLog(ctx context.Context, query string, purpose string, logger log.Logger) (string, error)

func (*ExternalTiDBGlue) OpenCheckpointsDB

func (e *ExternalTiDBGlue) OpenCheckpointsDB(ctx context.Context, cfg *config.Config) (checkpoints.DB, error)

func (*ExternalTiDBGlue) OwnsSQLExecutor

func (e *ExternalTiDBGlue) OwnsSQLExecutor() bool

func (*ExternalTiDBGlue) QueryStringsWithLog

func (e *ExternalTiDBGlue) QueryStringsWithLog(ctx context.Context, query string, purpose string, logger log.Logger) (result [][]string, finalErr error)

func (*ExternalTiDBGlue) Record

func (e *ExternalTiDBGlue) Record(string, uint64)

type Glue

type Glue interface {
	OwnsSQLExecutor() bool
	GetSQLExecutor() SQLExecutor
	GetDB() (*sql.DB, error)
	GetParser() *parser.Parser
	GetTables(context.Context, string) ([]*model.TableInfo, error)
	GetSession(context.Context) (checkpoints.Session, error)
	OpenCheckpointsDB(context.Context, *config.Config) (checkpoints.DB, error)
	// Record is used to report some information (key, value) to host TiDB, including progress, stage currently
	Record(string, uint64)
}

type SQLExecutor

type SQLExecutor interface {
	// ExecuteWithLog and ObtainStringWithLog should support concurrently call and can't assure different calls goes to
	// same underlying connection
	ExecuteWithLog(ctx context.Context, query string, purpose string, logger log.Logger) error
	ObtainStringWithLog(ctx context.Context, query string, purpose string, logger log.Logger) (string, error)
	QueryStringsWithLog(ctx context.Context, query string, purpose string, logger log.Logger) ([][]string, error)
	Close()
}

Jump to

Keyboard shortcuts

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