tidb: github.com/pingcap/tidb/sessionctx/binloginfo Index | Files

package binloginfo

import "github.com/pingcap/tidb/sessionctx/binloginfo"


Package Files


func AddOneSkippedCommitter Uses

func AddOneSkippedCommitter()

AddOneSkippedCommitter adds one committer to skippedCommitterCounter.

func AddSpecialComment Uses

func AddSpecialComment(ddlQuery string) string

AddSpecialComment uses to add comment for table option in DDL query. Export for testing.

func DisableSkipBinlogFlag Uses

func DisableSkipBinlogFlag()

DisableSkipBinlogFlag disable the skipBinlog flag.

func EnableSkipBinlogFlag Uses

func EnableSkipBinlogFlag()

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

func GetPrewriteValue Uses

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

GetPrewriteValue gets binlog prewrite value in the context.

func GetPumpsClient Uses

func GetPumpsClient() *pumpcli.PumpsClient

GetPumpsClient gets the pumps client instance.

func IsBinlogSkipped Uses

func IsBinlogSkipped() bool

IsBinlogSkipped gets the skipBinlog flag.

func MockPumpsClient Uses

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

MockPumpsClient creates a PumpsClient, used for test.

func RegisterStatusListener Uses

func RegisterStatusListener(listener func(BinlogStatus) error)

RegisterStatusListener registers a listener function to watch binlog status

func RemoveOneSkippedCommitter Uses

func RemoveOneSkippedCommitter()

RemoveOneSkippedCommitter removes one committer from skippedCommitterCounter.

func ResetSkippedCommitterCounter Uses

func ResetSkippedCommitterCounter()

ResetSkippedCommitterCounter is used to reset the skippedCommitterCounter.

func SetDDLBinlog Uses

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

SetDDLBinlog sets DDL binlog in the kv.Transaction.

func SetIgnoreError Uses

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 Uses

func SetPumpsClient(client *pumpcli.PumpsClient)

SetPumpsClient sets the pumps client instance.

func SkippedCommitterCount Uses

func SkippedCommitterCount() int32

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

func WaitBinlogRecover Uses

func WaitBinlogRecover(timeout time.Duration) error

WaitBinlogRecover returns when all committing transaction finished.

type BinlogInfo Uses

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

BinlogInfo contains binlog data and binlog client.

func (*BinlogInfo) WriteBinlog Uses

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

WriteBinlog writes a binlog to Pump.

type BinlogRecoverStatus Uses

type BinlogRecoverStatus struct {
    Skipped                 bool
    SkippedCommitterCounter int32

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

func GetBinlogStatus Uses

func GetBinlogStatus() *BinlogRecoverStatus

GetBinlogStatus returns the binlog recovered status.

type BinlogStatus Uses

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
    //BinlogStatusOff stands for the binlog is disabled
    //BinlogStatusSkipping stands for the binlog status

func GetStatus Uses

func GetStatus() BinlogStatus

GetStatus gets the status of binlog

func (BinlogStatus) String Uses

func (s BinlogStatus) String() string

String implements String function in fmt.Stringer

type WriteResult Uses

type WriteResult struct {
    // contains filtered or unexported fields

WriteResult is used for the returned chan of WriteBinlog.

func (*WriteResult) GetError Uses

func (wr *WriteResult) GetError() error

GetError gets the error of WriteBinlog.

func (*WriteResult) Skipped Uses

func (wr *WriteResult) Skipped() bool

Skipped if true stands for the binlog writing is skipped.

Package binloginfo imports 19 packages (graph) and is imported by 173 packages. Updated 2020-05-31. Refresh now. Tools for package owners.