Documentation ¶
Index ¶
- Variables
- func IsEventBelongsToMyself(event *replication.RowsEvent, gravityID uint32) bool
- func NewBarrierMsg(ts int64, callback core.AfterMsgCommitFunc) *core.Msg
- func NewDDLMsg(callback core.AfterMsgCommitFunc, dbName string, table string, ...) *core.Msg
- func NewDeleteMsgs(host string, database string, table string, ts int64, ...) ([]*core.Msg, error)
- func NewInsertMsgs(host string, database string, table string, ts int64, ...) ([]*core.Msg, error)
- func NewUpdateMsgs(host string, database string, table string, ts int64, ...) ([]*core.Msg, error)
- func NewXIDMsg(ts int64, callback core.AfterMsgCommitFunc, position utils.MySQLBinlogPosition) *core.Msg
- type BinlogEventSchemaFilterFunc
- type BinlogTailer
- func (tailer *BinlogTailer) AfterMsgCommit(msg *core.Msg) error
- func (tailer *BinlogTailer) AppendMsgTxnBuffer(msg *core.Msg)
- func (tailer *BinlogTailer) ClearMsgTxnBuffer()
- func (tailer *BinlogTailer) Close()
- func (tailer *BinlogTailer) FlushMsgTxnBuffer()
- func (tailer *BinlogTailer) Start() error
- func (tailer *BinlogTailer) Wait()
- type MySQLBinlogInputPluginConfig
- type SourceProbeCfg
Constants ¶
This section is empty.
Variables ¶
View Source
var ( GravityTableInsertCounter = prometheus.NewCounterVec(prometheus.CounterOpts{ Namespace: "drc_v2", Subsystem: "gravity", Name: "table_insert_rows_counter", Help: "table insert rows counter", }, []string{metrics.PipelineTag, "db", "table"}) GravityTableUpdateCounter = prometheus.NewCounterVec(prometheus.CounterOpts{ Namespace: "drc_v2", Subsystem: "gravity", Name: "table_update_rows_counter", Help: "table update rows counter", }, []string{metrics.PipelineTag, "db", "table"}) GravityTableDeleteCounter = prometheus.NewCounterVec(prometheus.CounterOpts{ Namespace: "drc_v2", Subsystem: "gravity", Name: "table_delete_rows_counter", Help: "table delete rows counter", }, []string{metrics.PipelineTag, "db", "table"}) GravityTableRowsEventSize = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Namespace: "drc_v2", Subsystem: "gravity", Name: "rows_event_size", Help: "rows event size per txn", }, []string{metrics.PipelineTag}) )
View Source
var ( // re-sync retry timeout RetryTimeout = 3 * time.Second BinlogProbeInterval = 3 * time.Second )
Functions ¶
func IsEventBelongsToMyself ¶
func IsEventBelongsToMyself(event *replication.RowsEvent, gravityID uint32) bool
func NewBarrierMsg ¶
func NewBarrierMsg(ts int64, callback core.AfterMsgCommitFunc) *core.Msg
func NewDeleteMsgs ¶
func NewInsertMsgs ¶
func NewUpdateMsgs ¶
func NewXIDMsg ¶
func NewXIDMsg(ts int64, callback core.AfterMsgCommitFunc, position utils.MySQLBinlogPosition) *core.Msg
Types ¶
type BinlogTailer ¶
type BinlogTailer struct {
// contains filtered or unexported fields
}
func NewBinlogTailer ¶
func NewBinlogTailer( pipelineName string, cfg *MySQLBinlogInputPluginConfig, gravityServerID uint32, positionStore position_store.MySQLPositionStore, sourceSchemaStore schema_store.SchemaStore, sourceDB *sql.DB, emitter core.Emitter, binlogChecker binlog_checker.BinlogChecker, binlogEventSchemaFilter BinlogEventSchemaFilterFunc, ) (*BinlogTailer, error)
NewBinlogTailer creats a new binlog tailer
func (*BinlogTailer) AfterMsgCommit ¶
func (tailer *BinlogTailer) AfterMsgCommit(msg *core.Msg) error
func (*BinlogTailer) AppendMsgTxnBuffer ¶
func (tailer *BinlogTailer) AppendMsgTxnBuffer(msg *core.Msg)
AppendMsgTxnBuffer adds basic job information to txn buffer
func (*BinlogTailer) ClearMsgTxnBuffer ¶
func (tailer *BinlogTailer) ClearMsgTxnBuffer()
func (*BinlogTailer) Close ¶
func (tailer *BinlogTailer) Close()
func (*BinlogTailer) FlushMsgTxnBuffer ¶
func (tailer *BinlogTailer) FlushMsgTxnBuffer()
FlushMsgTxnBuffer will flush job in txn buffer to queue. We will also filter out job that don't need to send out in this stage.
func (*BinlogTailer) Start ¶
func (tailer *BinlogTailer) Start() error
func (*BinlogTailer) Wait ¶
func (tailer *BinlogTailer) Wait()
type MySQLBinlogInputPluginConfig ¶
type MySQLBinlogInputPluginConfig struct { Source *utils.DBConfig `mapstructure:"source" toml:"source" json:"source"` IgnoreBiDirectionalData bool `mapstructure:"ignore-bidirectional-data" toml:"ignore-bidirectional-data" json:"ignore-bidirectional-data"` StartPosition *utils.MySQLBinlogPosition `mapstructure:"start-position" toml:"start-position" json:"start-position"` SourceProbeCfg *SourceProbeCfg `mapstructure:"source-probe-config"json:"source-probe-config"` // // internal configurations that is not exposed to users // DisableBinlogChecker bool `mapstructure:"-"json:"-"` DebugBinlog bool `mapstructure:"-"json:"-"` BinlogSyncerTimeout string `mapstructure:"-"json:"-"` }
type SourceProbeCfg ¶
Click to show internal directories.
Click to hide internal directories.