Documentation ¶
Index ¶
- Variables
- func GetFilterTables() (map[string][]string, []string, []string)
- func NewConsumerData()
- type MyEventHandler
- func (h *MyEventHandler) OnDDL(nextPos mysql.Position, queryEvent *replication.QueryEvent) error
- func (h *MyEventHandler) OnRow(e *canal.RowsEvent) error
- func (h *MyEventHandler) OnTableChanged(schema string, table string) error
- func (h *MyEventHandler) OnXID(pos mysql.Position) error
- func (h *MyEventHandler) String() string
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 ¶
GetFilterTables 为开源同步工具canal 收集需要同步的表信息, 目前暂不支持配置exclude tables
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 的名称
Click to show internal directories.
Click to hide internal directories.