checksum

package
v0.5.0-prerelease Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package checksum provides online checksum functionality. Two tables on the same MySQL server can be compared with only an initial lock. It is not in the row/ package because it requires a replClient to be passed in, which would cause a circular dependency.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	sync.Mutex

	ExecTime time.Duration
	// contains filtered or unexported fields
}

func NewChecker

func NewChecker(db *sql.DB, tbl, newTable *table.TableInfo, feed *repl.Client, config *CheckerConfig) (*Checker, error)

NewChecker creates a new checksum object.

func (*Checker) ChecksumChunk

func (c *Checker) ChecksumChunk(ctx context.Context, trxPool *dbconn.TrxPool, chunk *table.Chunk) error

func (*Checker) DifferencesFound

func (c *Checker) DifferencesFound() uint64

func (*Checker) RecentValue

func (c *Checker) RecentValue() string

func (*Checker) Run

func (c *Checker) Run(ctx context.Context) error

func (*Checker) StartTime

func (c *Checker) StartTime() time.Time

type CheckerConfig

type CheckerConfig struct {
	Concurrency     int
	TargetChunkTime time.Duration
	DBConfig        *dbconn.DBConfig
	Logger          loggers.Advanced
	FixDifferences  bool
}

func NewCheckerDefaultConfig

func NewCheckerDefaultConfig() *CheckerConfig

Jump to

Keyboard shortcuts

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