binloginfo

package
v1.1.0-beta.0...-7e13648 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOneSkippedCommitter

func AddOneSkippedCommitter()

AddOneSkippedCommitter adds one committer to skippedCommitterCounter.

func DisableSkipBinlogFlag

func DisableSkipBinlogFlag() error

DisableSkipBinlogFlag disable the skipBinlog flag.

func EnableSkipBinlogFlag

func EnableSkipBinlogFlag()

EnableSkipBinlogFlag enables the skipBinlog flag. NOTE: it is used *ONLY* for test.

func FormatAndAddTiDBSpecificComment

func FormatAndAddTiDBSpecificComment(ddlQuery string) (string, error)

FormatAndAddTiDBSpecificComment translate tidb feature syntax to tidb-specified comment. ddlQuery can be multiple-statements separated by ';' and the statement can be empty.

func GetPrewriteValue

func GetPrewriteValue(ctx sessionctx.Context, createIfNotExists bool) *binlog.PrewriteValue

GetPrewriteValue gets binlog prewrite value in the context.

func GetPumpsClient

func GetPumpsClient() *pumpcli.PumpsClient

GetPumpsClient gets the pumps client instance.

func IsBinlogSkipped

func IsBinlogSkipped() bool

IsBinlogSkipped gets the skipBinlog flag.

func MockPumpsClient

func MockPumpsClient(client binlog.PumpClient) *pumpcli.PumpsClient

MockPumpsClient creates a PumpsClient, used for test.

func RegisterStatusListener

func RegisterStatusListener(listener func(BinlogStatus) error)

RegisterStatusListener registers a listener function to watch binlog status

func RemoveOneSkippedCommitter

func RemoveOneSkippedCommitter()

RemoveOneSkippedCommitter removes one committer from skippedCommitterCounter.

func ResetSkippedCommitterCounter

func ResetSkippedCommitterCounter()

ResetSkippedCommitterCounter is used to reset the skippedCommitterCounter.

func SetDDLBinlog

func SetDDLBinlog(client *pumpcli.PumpsClient, txn kv.Transaction, jobID int64, ddlSchemaState int32, ddlQuery string)

SetDDLBinlog sets DDL binlog in the kv.Transaction.

func SetIgnoreError

func SetIgnoreError(on bool)

SetIgnoreError sets the ignoreError flag, this function called when TiDB start up and find config.Binlog.IgnoreError is true.

func SetPumpsClient

func SetPumpsClient(client *pumpcli.PumpsClient)

SetPumpsClient sets the pumps client instance.

func SkippedCommitterCount

func SkippedCommitterCount() int32

SkippedCommitterCount returns the number of alive committers whick skipped the binlog writing.

func WaitBinlogRecover

func WaitBinlogRecover(timeout time.Duration) error

WaitBinlogRecover returns when all committing transaction finished.

Types

type BinlogInfo

type BinlogInfo struct {
	Data   *binlog.Binlog
	Client *pumpcli.PumpsClient
}

BinlogInfo contains binlog data and binlog client.

func (*BinlogInfo) WriteBinlog

func (info *BinlogInfo) WriteBinlog(clusterID uint64) *WriteResult

WriteBinlog writes a binlog to Pump.

type BinlogRecoverStatus

type BinlogRecoverStatus struct {
	Skipped                 bool
	SkippedCommitterCounter int32
}

BinlogRecoverStatus is used for display the binlog recovered status after some operations.

func GetBinlogStatus

func GetBinlogStatus() *BinlogRecoverStatus

GetBinlogStatus returns the binlog recovered status.

type BinlogStatus

type BinlogStatus int

BinlogStatus is the status of binlog

const (
	// BinlogStatusUnknown stands for unknown binlog status
	BinlogStatusUnknown BinlogStatus = iota
	// BinlogStatusOn stands for the binlog is enabled
	BinlogStatusOn
	// BinlogStatusOff stands for the binlog is disabled
	BinlogStatusOff
	// BinlogStatusSkipping stands for the binlog status
	BinlogStatusSkipping
)

func GetStatus

func GetStatus() BinlogStatus

GetStatus gets the status of binlog

func (BinlogStatus) String

func (s BinlogStatus) String() string

String implements String function in fmt.Stringer

type WriteResult

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

WriteResult is used for the returned chan of WriteBinlog.

func (*WriteResult) GetError

func (wr *WriteResult) GetError() error

GetError gets the error of WriteBinlog.

func (*WriteResult) Skipped

func (wr *WriteResult) Skipped() bool

Skipped if true stands for the binlog writing is skipped.

Jump to

Keyboard shortcuts

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