dataparser

package
v0.0.0-...-948e253 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DDLTable []string

DDLTable 用来存放ddl变化的表,元素为db.tb

View Source
var (
	// XIDCommit 是否有XID 提交, 增量解析部分有XID event
	XIDCommit = false
)

Functions

func GetFilterTables

func GetFilterTables() (map[string][]string, []string, []string)

GetFilterTables 为开源同步工具canal 收集需要同步的表信息, 目前暂不支持配置exclude tables

func NewConsumerData

func NewConsumerData()

NewConsumerData 重置 consumer 数据

Types

type MyEventHandler

type MyEventHandler struct {
	canal.DummyEventHandler
}

MyEventHandler 事件处理

func (*MyEventHandler) OnDDL

func (h *MyEventHandler) OnDDL(nextPos mysql.Position, queryEvent *replication.QueryEvent) error

func (*MyEventHandler) OnRow

func (h *MyEventHandler) OnRow(e *canal.RowsEvent) error

OnRow 解析出来的binlog 事件结构,组装成数据发送给redisconsumer

func (*MyEventHandler) OnTableChanged

func (h *MyEventHandler) OnTableChanged(schema string, table string) error

ddl的时候会先收到OnTableChanged事件,再收到上面的OnDDL事件,当一个ddl语句涉及到多个表时,会收到多个OnTableChanged事件,一个OnDDL事件

func (*MyEventHandler) OnXID

func (h *MyEventHandler) OnXID(pos mysql.Position) error

OnXID 填充RedisDataMap Binlog File 与binlog Pos 字段。将消息发送给 消费者(redis 数据写入)

func (*MyEventHandler) String

func (h *MyEventHandler) String() string

String 返回mysql event handler 的名称

Jump to

Keyboard shortcuts

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