checker

package
v0.0.0-...-64decf6 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 40 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CheckTaskMsgHeader used as the header of the error/warning message when checking config failed.
	CheckTaskMsgHeader = "fail to check synchronization configuration with type"

	CheckTaskSuccess = "pre-check is passed. "

	// CheckSyncConfigFunc holds the CheckSyncConfig function.
	CheckSyncConfigFunc func(ctx context.Context, cfgs []*config.SubTaskConfig, errCnt, warnCnt int64) (string, error)
)

Functions

func CheckSyncConfig

func CheckSyncConfig(ctx context.Context, cfgs []*config.SubTaskConfig, errCnt, warnCnt int64) (string, error)

CheckSyncConfig checks synchronization configuration.

func RunCheckOnConfigs

func RunCheckOnConfigs(
	ctx context.Context,
	cfgs []*config.SubTaskConfig,
	dumpWholeInstance bool,
	warnLimit, errLimit int64,
) (*checker.Results, error)

RunCheckOnConfigs returns the check result for given subtask configs. Caller should be noticed that result may be very large. The result will be truncated to `warnLimit` and `errLimit`, but the total count in summary will be the same as the original result.

when `dumpWholeInstance` is true, checker will require SELECT ON *.* privileges for SourceDumpPrivilegeChecker.

This function is used by cloud services.

Types

type Checker

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

Checker performs pre-check of data synchronization.

func NewChecker

func NewChecker(cfgs []*config.SubTaskConfig, checkingItems map[string]string, errCnt, warnCnt int64) *Checker

NewChecker returns a checker.

func (*Checker) Close

func (c *Checker) Close()

Close implements Unit interface.

func (*Checker) Error

func (c *Checker) Error() interface{}

Error implements Unit interface.

func (*Checker) Init

func (c *Checker) Init(ctx context.Context) (err error)

Init implements Unit interface.

func (*Checker) IsFreshTask

func (c *Checker) IsFreshTask() (bool, error)

IsFreshTask implements Unit.IsFreshTask.

func (*Checker) Pause

func (c *Checker) Pause()

Pause implements Unit interface.

func (*Checker) Process

func (c *Checker) Process(ctx context.Context, pr chan pb.ProcessResult)

Process implements Unit interface.

func (*Checker) Resume

func (c *Checker) Resume(ctx context.Context, pr chan pb.ProcessResult)

Resume resumes the paused process.

func (*Checker) Status

func (c *Checker) Status(_ *binlog.SourceStatus) interface{}

Status implements Unit interface.

func (*Checker) Type

func (c *Checker) Type() pb.UnitType

Type implements Unit interface.

func (*Checker) Update

func (c *Checker) Update(ctx context.Context, cfg *config.SubTaskConfig) error

Update implements Unit.Update.

Jump to

Keyboard shortcuts

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