-
Notifications
You must be signed in to change notification settings - Fork 24
Add Support to ES 2.X #25
base: master
Are you sure you want to change the base?
Conversation
* ElasticsearchIntegrationTest migrated to ESIntegTestCase * ImmutableSettings migrated to Settings * Rollback to maven * Include static plugin-descriptor.properties * Instruct maven to pack plugin-descriptor.properties * Correct ES plugin package name * Added debug on SrvUnicastHostsProvider/lookupRecords * Fixes build jar hell by replacing hamcrest-all with hamcrest-library
|
Wonderful! Thank you, @falencastro ✨ I'm taking a look at it now 😃 |
|
Hanging issue solved. I was running with a default java.policy file, just needed to replace it with: |
|
Elasticsearch itself recently switched from Maven to Gradle (which is why I had done so for this plugin as well). Why did you roll back to Maven? |
| protected void bindDiscovery() { | ||
| bind(Discovery.class).to(SrvDiscovery.class).asEagerSingleton(); | ||
| protected void configure() { | ||
| logger.debug("starting srv services"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about Starting SRV discovery?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw that gradle was including unnecessary jars and storing them on a subfolder, while maven was generating proper zip files. Sure, the right thing to do is fix build.gradle, I'll take a look at this.
About the debug message, yeah, it will look better capitalized.
|
This PR mixes tabs and spaces. Can you make it all 4-space indentation like it was before? |
|
|
||
| protected List<DiscoveryNode> lookupNodes() throws TextParseException { | ||
| List<DiscoveryNode> discoNodes = Lists.newArrayList(); | ||
| List<DiscoveryNode> discoNodes = new ArrayList<DiscoveryNode>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, is new ArrayList<DiscoveryNode>() generally preferable to Lists.newArrayList()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
org.elasticsearch.common.collect.Lists which was being used, was removed from newer ES versions. I also took a look at consul-discovery.
I'll remove the tabs :)
|
I believe that you can actually remove |
I managed to solve this with https://github.com/github/elasticsearch-srv-discovery/pull/22/files#diff-c7aaa6daa650a88b917f442c2745dcabR59 It's pretty hacky because it pollutes the discovery namespace with something that should only be visible during testing, but I couldn't figure out another way around it. Let me know if you are able to get the test to work. |
* Remove maven support (pom.xml and src/main/assemblies/plugin.xml) * Move plugin-descriptor.properties to default gradle distribution folder * jar task adds lib/dnsjava-2.1.7.jar to classpath * providedCompile avoids packing unnecessary dependencies
* Remove src/main/java/org/elasticsearch/discovery/srv/SrvDiscoveryModule.java * Indetentation fixes * Removed tabs * Fix gradle dependencies for tests
|
Hi, I implemented your suggestions. From your last PR:
Still happening. Once you create this directory manually, test goes ahead but gets stuck at 85% after starting elasticsearch.
In ES 5 theres a gradle plugin called esplugin, which will solve this, something like this will generate a new plugin-descriptor.properties: esplugin {
name 'srv-discovery'
version '2.3.3'
description 'SRV record discovery plugin'
classname 'org.elasticsearch.plugin.discovery.srv.SrvDiscoveryPlugin'
}
Fixed on build.gradle: jar {
manifest {
attributes("Class-Path": configurations.compile.collect { "lib/$it.name" }.join(' '))
}
} |
|
Were you able to at least build the tests? When I run the test in IntelliJ, it also hangs at what appears to be the end: I'm not sure what's going on there.
Any idea why it's getting stuck during the test run? Thanks for looking into the versioning - I think we can tolerate hard-coding it until ES 5. And thanks for fixing that |
|
If I may chime in:
I think you could use a stub implementation like we did in https://github.com/crate/crate/blob/master/dns-discovery/src/test/java/io/crate/discovery/SrvDiscoveryIntegrationTest.java#L45 I think that way the whole
I think this could be solved by adding to the build.gradle Tests hang for me as well at 85% Didn't investigate but things I've noticed: The package namespace isn't correct. In I think the tests need to define the plugin in order to load it: And in |
* Null resourcesDir should fix java.nio.file.NoSuchFileException
It's compiling fine with maven (-Dmaven.test.skip=true).
Issues:
java.lang.IllegalArgumentException: Unknown Discovery type [srvtest].java.lang.ClassNotFoundException: org.xbill.DNS.TextParseExceptionhappens only if you build the project with gradle. That happens because build.gradle is generating a zipfile withdnsjava-2.1.7.jarstored insidelibssubfolder, instead of the root folder.Details: