Skip to content

Commit

Permalink
[Source-mongo] : Migrate to Kotlin (airbytehq#36845)
Browse files Browse the repository at this point in the history
  • Loading branch information
akashkulk committed Apr 5, 2024
1 parent 5631b4c commit c87ec5a
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 5 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 @@ -144,6 +144,7 @@ Maven and Gradle will automatically reference the correct (pinned) version of th

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:-----------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 0.29.2 | 2024-04-04 | [\#36845](https://github.com/airbytehq/airbyte/pull/36772) | Changes to make source-mongo compileable |
| 0.29.1 | 2024-04-03 | [\#36772](https://github.com/airbytehq/airbyte/pull/36772) | Changes to make source-mssql compileable |
| 0.29.0 | 2024-04-02 | [\#36759](https://github.com/airbytehq/airbyte/pull/36759) | Build artifact publication changes and fixes. |
| 0.28.21 | 2024-04-02 | [\#36673](https://github.com/airbytehq/airbyte/pull/36673) | Change the destination message parsing to use standard java/kotlin classes. Adds logging to catch empty lines. |
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=0.29.1
version=0.29.2
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface DebeziumEventConverter {
fun toAirbyteMessage(event: ChangeEventWithMetadata): AirbyteMessage

companion object {
@JvmStatic
fun buildAirbyteMessage(
source: JsonNode?,
cdcMetadataInjector: CdcMetadataInjector<*>,
Expand All @@ -35,6 +36,7 @@ interface DebeziumEventConverter {
.withRecord(airbyteRecordMessage)
}

@JvmStatic
fun addCdcMetadata(
baseNode: ObjectNode,
source: JsonNode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ object AutoCloseableIterators {
* @param <T> type
* @return new autocloseable iterator with the close function appended </T>
*/
@JvmStatic
fun <T> appendOnClose(
autoCloseableIterator: AutoCloseableIterator<T>,
voidCallable: VoidCallable
Expand Down Expand Up @@ -254,6 +255,7 @@ object AutoCloseableIterators {
return CompositeIterator(iterators, airbyteStreamStatusConsumer)
}

@JvmStatic
fun <T> concatWithEagerClose(iterators: List<AutoCloseableIterator<T>>): CompositeIterator<T> {
return concatWithEagerClose(iterators, null)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

airbyteJavaConnector {
cdkVersionRequired = '0.28.0'
cdkVersionRequired = '0.29.2'
features = ['db-sources', 'datastore-mongo']
useLocalCdk = false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ data:
connectorSubtype: database
connectorType: source
definitionId: b2e713cd-cc36-4c0a-b5bd-b47cb8a0561e
dockerImageTag: 1.3.1
dockerImageTag: 1.3.2
dockerRepository: airbyte/source-mongodb-v2
documentationUrl: https://docs.airbyte.com/integrations/sources/mongodb-v2
githubIssueLabel: source-mongodb-v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import io.debezium.connector.mongodb.ResumeTokens;
import java.util.Map;
import java.util.Objects;
import javax.annotation.Nullable;
import org.bson.BsonDocument;
import org.bson.BsonTimestamp;
import org.slf4j.Logger;
Expand Down Expand Up @@ -88,7 +89,7 @@ public boolean isEventAheadOffset(final Map<String, String> offset, final Change
}

@Override
public boolean isSameOffset(final Map<String, String> offsetA, final Map<String, String> offsetB) {
public boolean isSameOffset(@Nullable final Map<String, String> offsetA, @Nullable final Map<String, String> offsetB) {
if (offsetA == null || offsetA.size() != 1) {
return false;
}
Expand Down
3 changes: 2 additions & 1 deletion docs/integrations/sources/mongodb-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ For more information regarding configuration parameters, please see [MongoDb Doc

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:----------------------------------------------------------------------------------------------------------|
| 1.3.1 | 2024-04-04 | [36837](https://github.com/airbytehq/airbyte/pull/36837) | Full refresh read of collections. |
| 1.3.2 | 2024-04-04 | [36845](https://github.com/airbytehq/airbyte/pull/36845) | Adopt Kotlin CDK. |
| 1.3.1 | 2024-04-04 | [36837](https://github.com/airbytehq/airbyte/pull/36837) | Adopt CDK 0.28.0. |
| 1.3.0 | 2024-03-15 | [35669](https://github.com/airbytehq/airbyte/pull/35669) | Full refresh read of collections. |
| 1.2.16 | 2024-03-06 | [35669](https://github.com/airbytehq/airbyte/pull/35669) | State message will now include record count. |
| 1.2.15 | 2024-02-27 | [35673](https://github.com/airbytehq/airbyte/pull/35673) | Consume user provided connection string. |
Expand Down

0 comments on commit c87ec5a

Please sign in to comment.