Skip to content

Commit

Permalink
destination-mysql: convert prod code to kotlin (#40553)
Browse files Browse the repository at this point in the history
## What
<!--
* Describe what the change is solving. Link all GitHub issues related to this change.
-->

## How
<!--
* Describe how code changes achieve the solution.
-->

## Review guide
<!--
1. `x.py`
2. `y.py`
-->

## User Impact
<!--
* What is the end result perceived by the user?
* If there are negative side effects, please list them. 
-->

## Can this PR be safely reverted and rolled back?
<!--
* If unsure, leave it blank.
-->
- [ ] YES 💚
- [ ] NO ❌
  • Loading branch information
stephane-airbyte authored and xiaohansong committed Jul 2, 2024
1 parent df38a4c commit 9aaaa26
Show file tree
Hide file tree
Showing 12 changed files with 631 additions and 588 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data:
connectorSubtype: database
connectorType: destination
definitionId: ca81ee7c-3163-4246-af40-094cc31e5e42
dockerImageTag: 1.0.1
dockerImageTag: 1.0.2
dockerRepository: airbyte/destination-mysql-strict-encrypt
githubIssueLabel: destination-mysql
icon: mysql.svg
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright (c) 2023 Airbyte, Inc., all rights reserved.
*/
package io.airbyte.integrations.destination.mysql

import com.fasterxml.jackson.databind.node.ObjectNode
import io.airbyte.cdk.db.jdbc.JdbcUtils
import io.airbyte.cdk.integrations.base.Destination
import io.airbyte.cdk.integrations.base.IntegrationRunner
import io.airbyte.cdk.integrations.base.spec_modification.SpecModifyingDestination
import io.airbyte.commons.json.Jsons
import io.airbyte.protocol.models.v0.ConnectorSpecification
import org.slf4j.Logger
import org.slf4j.LoggerFactory

class MySQLDestinationStrictEncrypt :
SpecModifyingDestination(MySQLDestination.sshWrappedDestination()), Destination {
override fun modifySpec(originalSpec: ConnectorSpecification): ConnectorSpecification {
val spec: ConnectorSpecification = Jsons.clone(originalSpec)
(spec.connectionSpecification["properties"] as ObjectNode).remove(JdbcUtils.SSL_KEY)
return spec
}

companion object {
private val LOGGER: Logger =
LoggerFactory.getLogger(MySQLDestinationStrictEncrypt::class.java)

@Throws(Exception::class)
@JvmStatic
fun main(args: Array<String>) {
val destination: Destination = MySQLDestinationStrictEncrypt()
LOGGER.info("starting destination: {}", MySQLDestinationStrictEncrypt::class.java)
try {
IntegrationRunner(destination).run(args)
} catch (e: Exception) {
MySQLDestination.handleException(e)
}
LOGGER.info("completed destination: {}", MySQLDestinationStrictEncrypt::class.java)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ java {
}
}

compileKotlin.compilerOptions.allWarningsAsErrors = false

airbyteJavaConnector.addCdkDependencies()

application {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ data:
connectorSubtype: database
connectorType: destination
definitionId: ca81ee7c-3163-4246-af40-094cc31e5e42
dockerImageTag: 1.0.1
dockerImageTag: 1.0.2
dockerRepository: airbyte/destination-mysql
githubIssueLabel: destination-mysql
icon: mysql.svg
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 9aaaa26

Please sign in to comment.