reparo

package
v0.0.0-...-6fba4f8 Latest Latest
Warning

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

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

README

Reparo is a TiDB binlog recovery tool which is named from Harry Potter, a famous fiction by J. K. Rowling.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(r io.Reader) (*pb.Binlog, int64, error)

Decode decodes binlog from protobuf content. return *pb.Binlog and how many bytes read from reader

Types

type Config

type Config struct {
	*flag.FlagSet `toml:"-" json:"-"`
	Dir           string `toml:"data-dir" json:"data-dir"`
	StartDatetime string `toml:"start-datetime" json:"start-datetime"`
	StopDatetime  string `toml:"stop-datetime" json:"stop-datetime"`
	StartTSO      int64  `toml:"start-tso" json:"start-tso"`
	StopTSO       int64  `toml:"stop-tso" json:"stop-tso"`
	TxnBatch      int    `toml:"txn-batch" json:"txn-batch"`
	WorkerCount   int    `toml:"worker-count" json:"worker-count"`

	DestType string           `toml:"dest-type" json:"dest-type"`
	DestDB   *syncer.DBConfig `toml:"dest-db" json:"dest-db"`

	DoTables []filter.TableName `toml:"replicate-do-table" json:"replicate-do-table"`
	DoDBs    []string           `toml:"replicate-do-db" json:"replicate-do-db"`

	IgnoreTables []filter.TableName `toml:"replicate-ignore-table" json:"replicate-ignore-table"`
	IgnoreDBs    []string           `toml:"replicate-ignore-db" json:"replicate-ignore-db"`

	LogFile  string `toml:"log-file" json:"log-file"`
	LogLevel string `toml:"log-level" json:"log-level"`

	SafeMode bool `toml:"safe-mode" json:"safe-mode"`
	// contains filtered or unexported fields
}

Config is the main configuration for the retore tool.

func NewConfig

func NewConfig() *Config

NewConfig creates a Config object.

func (*Config) Parse

func (c *Config) Parse(args []string) (err error)

Parse parses keys/values from command line flags and toml configuration file.

func (*Config) String

func (c *Config) String() string

type PbReader

type PbReader interface {
	// contains filtered or unexported methods
}

PbReader is a reader to read pb Binlog

type Reparo

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

Reparo i the main part of the recovery tool.

func New

func New(cfg *Config) (*Reparo, error)

New creates a Reparo object.

func (*Reparo) Close

func (r *Reparo) Close() error

Close closes the Reparo object.

func (*Reparo) Process

func (r *Reparo) Process() error

Process runs the main procedure.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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