Documentation ¶
Index ¶
- func AddOneSkippedCommitter()
- func DisableSkipBinlogFlag() error
- func EnableSkipBinlogFlag()
- func FormatAndAddTiDBSpecificComment(ddlQuery string) (string, error)
- func GetPrewriteValue(ctx sessionctx.Context, createIfNotExists bool) *binlog.PrewriteValue
- func GetPumpsClient() *pumpcli.PumpsClient
- func IsBinlogSkipped() bool
- func MockPumpsClient(client binlog.PumpClient) *pumpcli.PumpsClient
- func RegisterStatusListener(listener func(BinlogStatus) error)
- func RemoveOneSkippedCommitter()
- func ResetSkippedCommitterCounter()
- func SetDDLBinlog(client *pumpcli.PumpsClient, txn kv.Transaction, jobID int64, ...)
- func SetIgnoreError(on bool)
- func SetPumpsClient(client *pumpcli.PumpsClient)
- func SkippedCommitterCount() int32
- func WaitBinlogRecover(timeout time.Duration) error
- type BinlogInfo
- type BinlogRecoverStatus
- type BinlogStatus
- type WriteResult
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 ¶
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 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 ¶
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 ¶
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 (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.