Skip to content

Commit

Permalink
[DB sources] : Reduce CDC state compression limit to 1MB (airbytehq#3…
Browse files Browse the repository at this point in the history
  • Loading branch information
akashkulk authored and jatinyadav-cc committed Feb 26, 2024
1 parent 066c160 commit 132412f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions airbyte-cdk/java/airbyte-cdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ MavenLocal debugging steps:

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:-----------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 0.21.4 | 2024-02-21 | [\#35511](https://github.com/airbytehq/airbyte/pull/35511) | Add Junit progress information to the test logs |
| 0.21.3 | 2024-02-20 | [\#35394](https://github.com/airbytehq/airbyte/pull/35394) | Add Junit progress information to the test logs |
| 0.21.2 | 2024-02-20 | [\#34978](https://github.com/airbytehq/airbyte/pull/34978) | Reduce log noise in NormalizationLogParser. |
| 0.21.1 | 2024-02-20 | [\#35199](https://github.com/airbytehq/airbyte/pull/35199) | Add thread names to the logs. |
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=0.21.3
version=0.21.4
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
public class AirbyteSchemaHistoryStorage {

private static final Logger LOGGER = LoggerFactory.getLogger(AirbyteSchemaHistoryStorage.class);
private static final long SIZE_LIMIT_TO_COMPRESS_MB = 3;
private static final long SIZE_LIMIT_TO_COMPRESS_MB = 1;
public static final int ONE_MB = 1024 * 1024;
private static final Charset UTF8 = StandardCharsets.UTF_8;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
public class AirbyteSchemaHistoryStorageTest {

@Test
public void testForContentBiggerThan3MBLimit() throws IOException {
final String contentReadDirectlyFromFile = MoreResources.readResource("dbhistory_greater_than_3_mb.dat");
public void testForContentBiggerThan1MBLimit() throws IOException {
final String contentReadDirectlyFromFile = MoreResources.readResource("dbhistory_greater_than_1_mb.dat");

final AirbyteSchemaHistoryStorage schemaHistoryStorageFromUncompressedContent = AirbyteSchemaHistoryStorage.initializeDBHistory(
new SchemaHistory<>(Optional.of(Jsons.jsonNode(contentReadDirectlyFromFile)),
Expand All @@ -46,14 +46,14 @@ public void testForContentBiggerThan3MBLimit() throws IOException {
@Test
public void sizeTest() throws IOException {
assertEquals(5.881045341491699,
AirbyteSchemaHistoryStorage.calculateSizeOfStringInMB(MoreResources.readResource("dbhistory_greater_than_3_mb.dat")));
AirbyteSchemaHistoryStorage.calculateSizeOfStringInMB(MoreResources.readResource("dbhistory_greater_than_1_mb.dat")));
assertEquals(0.0038671493530273438,
AirbyteSchemaHistoryStorage.calculateSizeOfStringInMB(MoreResources.readResource("dbhistory_less_than_3_mb.dat")));
AirbyteSchemaHistoryStorage.calculateSizeOfStringInMB(MoreResources.readResource("dbhistory_less_than_1_mb.dat")));
}

@Test
public void testForContentLessThan3MBLimit() throws IOException {
final String contentReadDirectlyFromFile = MoreResources.readResource("dbhistory_less_than_3_mb.dat");
public void testForContentLessThan1MBLimit() throws IOException {
final String contentReadDirectlyFromFile = MoreResources.readResource("dbhistory_less_than_1_mb.dat");

final AirbyteSchemaHistoryStorage schemaHistoryStorageFromUncompressedContent = AirbyteSchemaHistoryStorage.initializeDBHistory(
new SchemaHistory<>(Optional.of(Jsons.jsonNode(contentReadDirectlyFromFile)),
Expand Down

0 comments on commit 132412f

Please sign in to comment.