-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from alibaba/master
pull
- Loading branch information
Showing
31 changed files
with
5,237 additions
and
4,312 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/GtidLogEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/TransactionContextLogEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.taobao.tddl.dbsync.binlog.event; | ||
|
||
import com.taobao.tddl.dbsync.binlog.LogBuffer; | ||
import com.taobao.tddl.dbsync.binlog.LogEvent; | ||
|
||
/** | ||
* @author agapple 2018年5月7日 下午7:05:39 | ||
* @version 1.0.26 | ||
* @since mysql 5.7 | ||
*/ | ||
public class TransactionContextLogEvent extends LogEvent { | ||
|
||
public TransactionContextLogEvent(LogHeader header, LogBuffer buffer, FormatDescriptionLogEvent descriptionEvent){ | ||
super(header); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/ViewChangeEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.taobao.tddl.dbsync.binlog.event; | ||
|
||
import com.taobao.tddl.dbsync.binlog.LogBuffer; | ||
import com.taobao.tddl.dbsync.binlog.LogEvent; | ||
|
||
/** | ||
* @author agapple 2018年5月7日 下午7:05:39 | ||
* @version 1.0.26 | ||
* @since mysql 5.7 | ||
*/ | ||
public class ViewChangeEvent extends LogEvent { | ||
|
||
public ViewChangeEvent(LogHeader header, LogBuffer buffer, FormatDescriptionLogEvent descriptionEvent){ | ||
super(header); | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/XaPrepareLogEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package com.taobao.tddl.dbsync.binlog.event; | ||
|
||
import com.taobao.tddl.dbsync.binlog.LogBuffer; | ||
import com.taobao.tddl.dbsync.binlog.LogEvent; | ||
|
||
/** | ||
* @author agapple 2018年5月7日 下午7:05:39 | ||
* @version 1.0.26 | ||
* @since mysql 5.7 | ||
*/ | ||
public class XaPrepareLogEvent extends LogEvent { | ||
|
||
private boolean onePhase; | ||
private int formatId; | ||
private int gtridLength; | ||
private int bqualLength; | ||
private byte[] data; | ||
|
||
public XaPrepareLogEvent(LogHeader header, LogBuffer buffer, FormatDescriptionLogEvent descriptionEvent){ | ||
super(header); | ||
|
||
final int commonHeaderLen = descriptionEvent.getCommonHeaderLen(); | ||
final int postHeaderLen = descriptionEvent.getPostHeaderLen()[header.getType() - 1]; | ||
|
||
int offset = commonHeaderLen + postHeaderLen; | ||
buffer.position(offset); | ||
|
||
onePhase = (buffer.getInt8() == 0x00 ? false : true); | ||
|
||
formatId = buffer.getInt32(); | ||
gtridLength = buffer.getInt32(); | ||
bqualLength = buffer.getInt32(); | ||
|
||
int MY_XIDDATASIZE = 128; | ||
if (MY_XIDDATASIZE >= gtridLength + bqualLength && gtridLength >= 0 && gtridLength <= 64 && bqualLength >= 0 | ||
&& bqualLength <= 64) { | ||
data = buffer.getData(gtridLength + bqualLength); | ||
} else { | ||
formatId = -1; | ||
gtridLength = 0; | ||
bqualLength = 0; | ||
} | ||
} | ||
|
||
public boolean isOnePhase() { | ||
return onePhase; | ||
} | ||
|
||
public int getFormatId() { | ||
return formatId; | ||
} | ||
|
||
public int getGtridLength() { | ||
return gtridLength; | ||
} | ||
|
||
public int getBqualLength() { | ||
return bqualLength; | ||
} | ||
|
||
public byte[] getData() { | ||
return data; | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
...nc/src/main/java/com/taobao/tddl/dbsync/binlog/event/mariadb/StartEncryptionLogEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.taobao.tddl.dbsync.binlog.event.mariadb; | ||
|
||
import com.taobao.tddl.dbsync.binlog.LogBuffer; | ||
import com.taobao.tddl.dbsync.binlog.LogEvent; | ||
import com.taobao.tddl.dbsync.binlog.event.FormatDescriptionLogEvent; | ||
import com.taobao.tddl.dbsync.binlog.event.LogHeader; | ||
|
||
/** | ||
* mariadb的Start_encryption_log_event | ||
* | ||
* @author agapple 2018年5月7日 下午7:23:02 | ||
* @version 1.0.26 | ||
*/ | ||
public class StartEncryptionLogEvent extends LogEvent { | ||
|
||
public StartEncryptionLogEvent(LogHeader header, LogBuffer buffer, FormatDescriptionLogEvent descriptionEvent){ | ||
super(header); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.