Skip to content

Commit

Permalink
source-elasticsearch: adopt CDK 0.20.4 (#35230)
Browse files Browse the repository at this point in the history
  • Loading branch information
postamar authored Feb 14, 2024
1 parent fd0b77e commit 1c3a6e2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 16 deletions.
16 changes: 3 additions & 13 deletions airbyte-integrations/connectors/source-elasticsearch/build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
plugins {
id 'application'
id 'airbyte-java-connector'
}

airbyteJavaConnector {
cdkVersionRequired = '0.2.0'
cdkVersionRequired = '0.20.4'
features = ['db-sources']
useLocalCdk = false
}

//remove once upgrading the CDK version to 0.4.x or later
java {
compileJava {
options.compilerArgs.remove("-Werror")
}
}

airbyteJavaConnector.addCdkDependencies()

application {
mainClass = 'io.airbyte.integrations.source.elasticsearch.ElasticsearchSource'
applicationDefaultJvmArgs = ['-XX:+ExitOnOutOfMemoryError', '-XX:MaxRAMPercentage=75.0']
Expand All @@ -26,6 +16,7 @@ application {
dependencies {

implementation 'co.elastic.clients:elasticsearch-java:7.15.0'
implementation 'org.elasticsearch.client:elasticsearch-rest-high-level-client:7.15.2'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.3'

// EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
Expand All @@ -39,6 +30,5 @@ dependencies {

// MIT
// https://www.testcontainers.org/
testImplementation libs.testcontainers.elasticsearch
integrationTestJavaImplementation libs.testcontainers.elasticsearch
testImplementation 'org.testcontainers:elasticsearch:1.19.4'
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: 7cf88806-25f5-4e1a-b422-b2fa9e1b0090
dockerImageTag: 0.1.1
dockerImageTag: 0.1.2
dockerRepository: airbyte/source-elasticsearch
githubIssueLabel: source-elasticsearch
icon: elasticsearch.svg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.elasticsearch.client.indices.GetMappingsRequest;
import org.elasticsearch.client.indices.GetMappingsResponse;
import org.elasticsearch.cluster.metadata.MappingMetadata;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.Scroll;
import org.elasticsearch.search.SearchHit;
Expand All @@ -44,6 +44,7 @@ public class ElasticsearchConnection {
*
* @param config Configuration parameters for connecting to the Elasticsearch host
*/
@SuppressWarnings("this-escape")
public ElasticsearchConnection(ConnectorConfiguration config) {
log.info(String.format(
"creating ElasticsearchConnection: %s", config.getEndpoint()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import io.airbyte.cdk.integrations.standardtest.source.SourceAcceptanceTest;
import io.airbyte.cdk.integrations.standardtest.source.TestDestinationEnv;
import io.airbyte.cdk.integrations.util.HostPortResolver;
import io.airbyte.commons.jackson.MoreMappers;
import io.airbyte.commons.json.Jsons;
import io.airbyte.commons.resources.MoreResources;
Expand Down Expand Up @@ -47,7 +48,7 @@ protected String getImageName() {
@Override
protected JsonNode getConfig() {
var configJson = mapper.createObjectNode();
configJson.put("endpoint", String.format("http://%s:%s", container.getHost(), container.getMappedPort(9200)));
configJson.put("endpoint", String.format("http://%s:%s", HostPortResolver.resolveHost(container), HostPortResolver.resolvePort(container)));
return configJson;
}

Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ all values in the array must be of the same data type. Hence, every field can be

| Version | Date | Pull Request | Subject |
|:--------| :--------- | :------------------------------------------------------- | :-------------- |
| 0.1.2 | 2024-02-13 | [35230](https://github.com/airbytehq/airbyte/pull/35230) | Adopt CDK 0.20.4 |
| `0.1.2` | 2024-01-24 | [34453](https://github.com/airbytehq/airbyte/pull/34453) | bump CDK version |
| `0.1.1` | 2022-12-02 | [18118](https://github.com/airbytehq/airbyte/pull/18118) | Avoid too_long_frame_exception |
| `0.1.0` | 2022-07-12 | [14118](https://github.com/airbytehq/airbyte/pull/14118) | Initial Release |

0 comments on commit 1c3a6e2

Please sign in to comment.