Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to elasticsearch-java 8 #320

Merged
merged 1 commit into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=lf
202 changes: 202 additions & 0 deletions config/accepted-api-changes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
[
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchAsyncClient3$Definition$Reference",
"member": "Class io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchAsyncClient3$Definition$Reference",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchAsyncClient3$Definition$Reference",
"member": "Field $ANNOTATION_METADATA",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchAsyncClient3$Definition$Reference",
"member": "Method io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchAsyncClient3$Definition$Reference.getBeanDefinitionType()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchAsyncClient3$Definition$Reference",
"member": "Method io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchAsyncClient3$Definition$Reference.getBeanType()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchAsyncClient3$Definition$Reference",
"member": "Method io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchAsyncClient3$Definition$Reference.load()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchAsyncClient3$Definition$Reference",
"member": "Constructor io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchAsyncClient3$Definition$Reference()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchClient2$Definition$Reference",
"member": "Class io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchClient2$Definition$Reference",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchClient2$Definition$Reference",
"member": "Field $ANNOTATION_METADATA",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchClient2$Definition$Reference",
"member": "Method io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchClient2$Definition$Reference.getBeanDefinitionType()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchClient2$Definition$Reference",
"member": "Method io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchClient2$Definition$Reference.getBeanType()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchClient2$Definition$Reference",
"member": "Method io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchClient2$Definition$Reference.load()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchClient2$Definition$Reference",
"member": "Constructor io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchClient2$Definition$Reference()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchTransport4$Definition$Reference",
"member": "Class io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchTransport4$Definition$Reference",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchTransport4$Definition$Reference",
"member": "Field $ANNOTATION_METADATA",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchTransport4$Definition$Reference",
"member": "Method io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchTransport4$Definition$Reference.getBeanDefinitionType()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchTransport4$Definition$Reference",
"member": "Method io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchTransport4$Definition$Reference.getBeanType()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchTransport4$Definition$Reference",
"member": "Method io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchTransport4$Definition$Reference.load()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchTransport4$Definition$Reference",
"member": "Constructor io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$ElasticsearchTransport4$Definition$Reference()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestClient1$Definition$Reference",
"member": "Class io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestClient1$Definition$Reference",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestClient1$Definition$Reference",
"member": "Field $ANNOTATION_METADATA",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestClient1$Definition$Reference",
"member": "Method io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestClient1$Definition$Reference.getBeanDefinitionType()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestClient1$Definition$Reference",
"member": "Method io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestClient1$Definition$Reference.getBeanType()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestClient1$Definition$Reference",
"member": "Method io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestClient1$Definition$Reference.load()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestClient1$Definition$Reference",
"member": "Constructor io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestClient1$Definition$Reference()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestHighLevelClient0$Definition$Reference",
"member": "Class io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestHighLevelClient0$Definition$Reference",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestHighLevelClient0$Definition$Reference",
"member": "Field $ANNOTATION_METADATA",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestHighLevelClient0$Definition$Reference",
"member": "Field $ANNOTATION_METADATA",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestHighLevelClient0$Definition$Reference",
"member": "Method io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestHighLevelClient0$Definition$Reference.getBeanType()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestHighLevelClient0$Definition$Reference",
"member": "Method io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestHighLevelClient0$Definition$Reference.load()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestHighLevelClient0$Definition$Reference",
"member": "Constructor io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestHighLevelClient0$Definition$Reference()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestHighLevelClient0$Definition$Reference",
"member": "Method io.micronaut.elasticsearch.$DefaultElasticsearchClientFactory$RestHighLevelClient0$Definition$Reference.getBeanDefinitionType()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.health.$ElasticsearchHealthIndicator$Definition$Reference",
"member": "Class io.micronaut.elasticsearch.health.$ElasticsearchHealthIndicator$Definition$Reference",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.health.$ElasticsearchHealthIndicator$Definition$Reference",
"member": "Field $ANNOTATION_METADATA",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.health.$ElasticsearchHealthIndicator$Definition$Reference",
"member": "Method io.micronaut.elasticsearch.health.$ElasticsearchHealthIndicator$Definition$Reference.getBeanDefinitionType()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.health.$ElasticsearchHealthIndicator$Definition$Reference",
"member": "Method io.micronaut.elasticsearch.health.$ElasticsearchHealthIndicator$Definition$Reference.getBeanType()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.health.$ElasticsearchHealthIndicator$Definition$Reference",
"member": "Method io.micronaut.elasticsearch.health.$ElasticsearchHealthIndicator$Definition$Reference.load()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.health.$ElasticsearchHealthIndicator$Definition$Reference",
"member": "Constructor io.micronaut.elasticsearch.health.$ElasticsearchHealthIndicator$Definition$Reference()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.health.ElasticsearchHealthIndicator",
"member": "Class io.micronaut.elasticsearch.health.ElasticsearchHealthIndicator",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.health.ElasticsearchHealthIndicator",
"member": "Method io.micronaut.elasticsearch.health.ElasticsearchHealthIndicator.getResult()",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
},
{
"type": "io.micronaut.elasticsearch.health.ElasticsearchHealthIndicator",
"member": "Constructor io.micronaut.elasticsearch.health.ElasticsearchHealthIndicator(org.elasticsearch.client.RestHighLevelClient)",
"reason": "Changes for compatibility with elasticsearch-java 8.2.0"
}
]
1 change: 0 additions & 1 deletion elasticsearch/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins {

dependencies {
annotationProcessor mn.micronaut.graal
api "org.elasticsearch.client:elasticsearch-rest-high-level-client:$elasticsearchVersion"
api "co.elastic.clients:elasticsearch-java:$elasticsearchVersion"
api mn.micronaut.http
api mn.micronaut.validation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;

import co.elastic.clients.elasticsearch.ElasticsearchAsyncClient;
import co.elastic.clients.elasticsearch.ElasticsearchClient;
Expand All @@ -44,17 +43,6 @@
@Factory
public class DefaultElasticsearchClientFactory {

/**
* Create the {@link RestHighLevelClient} bean for the given configuration.
*
* @param elasticsearchConfiguration The {@link DefaultElasticsearchConfigurationProperties} object
* @return A {@link RestHighLevelClient} bean
*/
@Bean(preDestroy = "close")
RestHighLevelClient restHighLevelClient(DefaultElasticsearchConfigurationProperties elasticsearchConfiguration) {
return new RestHighLevelClient(restClientBuilder(elasticsearchConfiguration));
}

/**
* @param elasticsearchConfiguration The {@link DefaultElasticsearchConfigurationProperties} object
* @return The Elasticsearch Rest Client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
import io.micronaut.context.annotation.Factory;
import io.micronaut.context.annotation.Requires;
import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;

import jakarta.inject.Singleton;
import org.elasticsearch.client.RestClient;

/**
* The default factory used to create {@link HttpAsyncClientBuilder} for HTTP client configurations.
*
* @author Puneet Behl
* @since 1.0.0
*/
@Requires(classes = {RestHighLevelClient.class})
@Requires(classes = {RestClient.class})
@Factory
public class DefaultHttpAsyncClientBuilderFactory {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import io.micronaut.elasticsearch.ElasticsearchSettings;
import io.micronaut.context.annotation.Requires;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.client.RestClient;

import java.lang.annotation.*;

Expand All @@ -31,6 +31,6 @@
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.PACKAGE, ElementType.TYPE})
@Requires(property = ElasticsearchSettings.PREFIX)
@Requires(classes = {RestHighLevelClient.class})
@Requires(classes = {RestClient.class})
public @interface RequiresElasticsearch {
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
*
* We substitute it with an implementation which does not use serialization.
*
* Forked from Quarkus: https://github.com/quarkusio/quarkus/blob/c9cba824e8812fa3f15474b8382ac5d90f7238aa/extensions/elasticsearch-rest-client/runtime/src/main/java/io/quarkus/elasticsearch/restclient/runtime/graal/Substitute_RestClient.java
* Forked from Quarkus: https://github.com/quarkusio/quarkus/blob/main/extensions/elasticsearch-rest-client-common/runtime/src/main/java/io/quarkus/elasticsearch/restclient/common/runtime/graal/Substitute_RestClient.java
*
* @author Iván López
* @since 2.0.0
Expand Down Expand Up @@ -109,7 +109,7 @@ public NoSerializationBasicAuthCache() {
this(null);
}

protected HttpHost getKey(final HttpHost host) {
private HttpHost getKey(final HttpHost host) {
if (host.getPort() <= 0) {
final int port;
try {
Expand Down
Loading