Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Support for Elasticsearch 6.0.0 #20

Closed
wants to merge 19 commits into from

Conversation

gajicvedrana
Copy link

@gajicvedrana gajicvedrana commented Jan 19, 2018

Refs #19

mattflax and others added 19 commits December 12, 2016 13:55
Add ES5 string to version number for local builds.
- Change default nodeClient setting to false;
- Disabled unit tests for node client.

 Elastic recommend using a local coordinating client in conjunction with the TransportClient instead of NodeClient.
# Conflicts:
#	README.md
#	pom.xml
# Conflicts:
#	README.md
#	pom.xml
#	src/main/java/io/dropwizard/elasticsearch/util/TransportAddressHelper.java
#	src/test/java/io/dropwizard/elasticsearch/util/TransportAddressHelperTest.java
@coveralls
Copy link

Coverage Status

Coverage decreased (-7.2%) to 72.131% when pulling 2ab0f40 on engagetech:elasticsearch-6.0.0 into 4cc065c on dropwizard:master.

Copy link
Member

@joschi joschi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gajicvedrana Thanks for your contribution! 😃

There are a few things we have to address before we can merge this PR.

@@ -43,7 +43,7 @@ Configuration

The following configuration settings are supported by `EsConfiguration`:

* `nodeClient`: When `true`, `ManagedEsClient` will create a `NodeClient`, otherwise a `TransportClient`; default: `true`
* `nodeClient`: **DEPRECATED** Will throw an exception if `true`. Default: `false`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why keep this setting at all when the node client isn't supported any more?

@@ -59,6 +59,17 @@ The order of precedence is: `nodeClient`/`servers`/`clusterName` > `settings` >
any setting in `settingsFile` can be overwritten with `settings` which in turn get overwritten by the specific settings
like `clusterName`.

### Notes for Elasticsearch 5.x
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elasticsearch 5.x or 6.x? 😉

@@ -8,7 +8,7 @@

<groupId>io.dropwizard.modules</groupId>
<artifactId>dropwizard-elasticsearch</artifactId>
<version>1.2.0-2-SNAPSHOT</version>
<version>1.2.0-2-ES6.0.0-SNAPSHOT</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please restore the old version.

<elasticsearch.version>2.4.6</elasticsearch.version>
<elasticsearch.version>6.0.0</elasticsearch.version>
<!-- github server corresponds to entry in ~/.m2/settings.xml -->
<github.global.server>github</github.global.server>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's property is necessary.

<version>${elasticsearch.version}</version>
</dependency>
<!-- Required for ES 5.x -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of pulling in a second logging framework, this project should use the Log4j to SLF4J adapter.

@@ -24,7 +24,7 @@
private String clusterName = "elasticsearch";

@JsonProperty
private boolean nodeClient = true;
private boolean nodeClient = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the node client isn't supported anymore, this setting should be removed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.settings(settings)
.build();
this.client = this.node.client();
throw new UnsupportedOperationException("Node client is not allowed for Elasticsearch 6. Use a local coordinating node, and the transport client.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove that completely.

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.*;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use wildcard imports.

@@ -131,13 +160,13 @@ public void transportClientShouldBeCreatedFromConfig() throws URISyntaxException
transportClient.transportAddresses().get(2));
}

@Test
@Test @Ignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this test ignored?

@@ -148,13 +177,13 @@ public void managedClientShouldUseCustomElasticsearchConfig() throws URISyntaxEx
assertEquals("19300-19400", nodeClient.settings().get("transport.tcp.port"));
}

@Test
@Test @Ignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this test ignored?

@mattflax
Copy link

I have a version for ES 5.6 which has most of these changes in place. Do you have a preferred version numbering scheme? I doubt the ES6 version is likely to be compatible with ES5, but both are still in common use among clients I visit, so it would be good to have both available.

If you let me know, I'll create a separate PR for the ES5 version.

@joschi
Copy link
Member

joschi commented Jan 25, 2018

@mattflax Since Elasticsearch 5.x is already legacy, I'd rather not add support for it but jump straight to Elasticsearch 6.x.

@joschi
Copy link
Member

joschi commented Mar 16, 2018

@gajicvedrana Are you going to address the review comments or should I close this PR?

@joschi
Copy link
Member

joschi commented Mar 3, 2019

Closed due to inactivity.

@joschi joschi closed this Mar 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants