forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
postgres-cdc checkpointing: fix LSN parsing bug + refactor for effici…
…ency (airbytehq#24582) * Fix LSN parsing from Integer to Long * rebasing * Rebase * Rebase * Other casting * Lock the file only when reading, so the file is free when parsing the object. Increased from 1 to 166 checkpoints, and from skipping hundreds of checkpoints to never skip a state. * Update load function documentation * bump mysql and mssql * cdc: refactor to remove debezium dependency from connector packages * use gradle's shared dependency * more refactoring * upgrade docker version * resolve master merge conflicts * Automated Change * minor changes * resolve merge conflicts * avoid deserializing multiple times * simplify * enable checkpointing for Postgres * more improvements * enable assertions * changelog + bump version * auto-bump connector version * auto-bump connector version * manual bump --------- Co-authored-by: subodh <subodh1810@gmail.com> Co-authored-by: subodh1810 <subodh1810@users.noreply.github.com> Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
- Loading branch information
1 parent
2c1d0ea
commit 0467d9a
Showing
30 changed files
with
323 additions
and
303 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
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
39 changes: 39 additions & 0 deletions
39
...ium/src/main/java/io/airbyte/integrations/debezium/internals/ChangeEventWithMetadata.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,39 @@ | ||
/* | ||
* Copyright (c) 2023 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.integrations.debezium.internals; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
import io.airbyte.commons.json.Jsons; | ||
import io.debezium.engine.ChangeEvent; | ||
|
||
public class ChangeEventWithMetadata { | ||
|
||
private final ChangeEvent<String, String> event; | ||
private final JsonNode eventValueAsJson; | ||
private final SnapshotMetadata snapshotMetadata; | ||
|
||
public ChangeEventWithMetadata(final ChangeEvent<String, String> event) { | ||
this.event = event; | ||
this.eventValueAsJson = Jsons.deserialize(event.value()); | ||
this.snapshotMetadata = SnapshotMetadata.fromString(eventValueAsJson.get("source").get("snapshot").asText()); | ||
} | ||
|
||
public ChangeEvent<String, String> event() { | ||
return event; | ||
} | ||
|
||
public JsonNode eventValueAsJson() { | ||
return eventValueAsJson; | ||
} | ||
|
||
public boolean isSnapshotEvent() { | ||
return SnapshotMetadata.isSnapshotEventMetadata(snapshotMetadata); | ||
} | ||
|
||
public SnapshotMetadata snapshotMetadata() { | ||
return snapshotMetadata; | ||
} | ||
|
||
} |
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.