支持通过GTID同步binlog

This commit is contained in:
hiwjd
2018-05-02 15:28:11 +08:00
parent f46133d116
commit 21f3f8c973
22 changed files with 13479 additions and 12615 deletions

View File

@@ -55,7 +55,10 @@ message Header {
optional EventType eventType = 11 [default = UPDATE];
/**预留扩展**/
repeated Pair props = 12;
repeated Pair props = 12;
/**当前事务的gitd**/
optional string gtid = 13;
}
/**每个字段的数据结构**/
@@ -169,7 +172,8 @@ enum EntryType{
ROWDATA = 2;
TRANSACTIONEND = 3;
/** 心跳类型,内部使用,外部暂不可见,可忽略 **/
HEARTBEAT = 4;
HEARTBEAT = 4;
GTIDLOG = 5;
}
/** 事件类型 **/
@@ -186,6 +190,7 @@ enum EventType {
/**CREATE INDEX**/
CINDEX = 10;
DINDEX = 11;
GTID = 12;
}
/**数据库类型**/

View File

@@ -18,6 +18,7 @@ public class EntryPosition extends TimePosition {
private Long position;
// add by agapple at 2016-06-28
private Long serverId = null; // 记录一下位点对应的serverId
private String gtid = null;
public EntryPosition(){
super(null);
@@ -74,6 +75,14 @@ public class EntryPosition extends TimePosition {
this.serverId = serverId;
}
public String getGtid() {
return gtid;
}
public void setGtid(String gtid) {
this.gtid = gtid;
}
@Override
public int hashCode() {
final int prime = 31;