Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use long for GTID #2

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static boolean addKafkaMetaData(String colName, ClickHouseStruct record,
} else if (colName.equalsIgnoreCase(KafkaMetaData.SERVER_ID.getColumn())) {
ps.setLong(index, record.getServerId()) ;
} else if (colName.equalsIgnoreCase(KafkaMetaData.GTID.getColumn())) {
ps.setInt(index, record.getGtid());
ps.setLong(index, record.getGtid());
} else if (colName.equalsIgnoreCase(KafkaMetaData.BINLOG_FILE.getColumn())) {
ps.setString(index, record.getFile());
} else if (colName.equalsIgnoreCase(KafkaMetaData.BINLOG_POSITION.getColumn())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class BlockMetaData {

@Getter
@Setter
int transactionId = -1;
long transactionId = -1;

@Getter
@Setter
Expand All @@ -90,7 +90,7 @@ public class BlockMetaData {

public void update(ClickHouseStruct record) {

int gtId = record.getGtid();
long gtId = record.getGtid();
if (gtId != -1) {
if (gtId > this.transactionId) {
this.transactionId = gtId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class ClickHouseStruct {

@Getter
@Setter
private int gtid = -1;
private long gtid = -1;

@Getter
@Setter
Expand Down Expand Up @@ -220,7 +220,7 @@ public void setAdditionalMetaData(Map<String, Object> convertedValue) {
if(fieldNames.contains(GTID) && source.get(GTID) != null && source.get(GTID) instanceof String) {
String[] gtidArray = ((String) source.get(GTID)).split(":");
if(gtidArray.length == 2) {
this.setGtid(Integer.parseInt(gtidArray[1]));
this.setGtid(Long.parseLong(gtidArray[1]));
}
}
if(fieldNames.contains(LSN) && source.get(LSN) != null && source.get(LSN) instanceof Long) {
Expand Down