-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Add elasticsearch-nio jar for base nio classes #27801
Conversation
A couple notes:
|
We can do this but I feel like in a followup we should have a
I think that's ok for now.
I'd leave 6.x alone and just not backport stuff anymore there unless its simple. |
} | ||
} | ||
ExceptionsHelper.rethrowAndSuppress(closingExceptions); |
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.
Honestly I think we should just copy these helper classes 1 to 1 and then work on a common-lib jar. It's time for it anyway @rjernst @jasontedor WDYT?
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.
@s1monw I think it's probably time too, but I would want to use this opportunity to mark as much as possible in an internal package so that we are free to break whenever we want (obviously ActionListener
would not be in such a package). When we go JDK 9 minimum, we can take this further.
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.
Can we separate the steps?
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.
@s1monw All I am suggesting is that when we move something (e.g., a utility class) that does not need to be part of the public API (because it's for example not used in the client or the plugin API) that we mark it internal. Nothing more. 😄
@s1monw This is actually not perfectly straightforward. If I introduce an |
@tbrooks8 I am ok with that |
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 have a few comments on the gradle side.
libs/elasticsearch-nio/build.gradle
Outdated
apply plugin: 'nebula.maven-base-publish' | ||
apply plugin: 'nebula.maven-scm' | ||
|
||
targetCompatibility = JavaVersion.VERSION_1_8 |
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.
This shouldn't be necessary, it is the default set by elasticsearch.build
libs/elasticsearch-nio/build.gradle
Outdated
targetCompatibility = JavaVersion.VERSION_1_8 | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
|
||
group = 'org.elasticsearch' |
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.
Same here, not necessary.
libs/elasticsearch-nio/build.gradle
Outdated
} | ||
|
||
// TODO: Currently disable licenses check as we rely on mocksocket | ||
dependencyLicenses.enabled = false |
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.
What does the license check being disabled have to do with mocksocket?
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.
Mocksocket would need the license, sha, and notice. The mocksocket repository does not currently have a “notice” which is why I disabled the license check for right now.
I can add a notice, but I imagine we don’t want to actually release this depending on mocksocket.
libs/elasticsearch-nio/build.gradle
Outdated
|
||
dependencies { | ||
compile "org.apache.logging.log4j:log4j-api:${versions.log4j}" | ||
compile "org.elasticsearch:mocksocket:${versions.mocksocket}" |
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.
This means mocksocket would need to be published and a production dependency of the transport-nio module right? That seems backwards to me. Why wouldn't the tie in to mocksocket be inside test framework?
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.
This is explained in this comment. Our permission code applies permissions to jars. I can give all of elasticsearch-nio socket permissions, but the IntelliJ test runner does not compile that to a jar. So we do not properly apply permissions and tests are broken in IntelliJ.
I don’t think we want to release with this depending on mocksocket. I just did not see an immediate resolution for that issue in this PR.
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.
LGTM
libs/elasticsearch-nio/build.gradle
Outdated
apply plugin: 'nebula.maven-base-publish' | ||
apply plugin: 'nebula.maven-scm' | ||
|
||
group = 'org.elasticsearch' |
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.
This shouldn't be necessary.
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.
LGTM.
} | ||
|
||
//JarHell is part of es core, which we don't want to pull in | ||
jarHell.enabled=false |
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 will open a separate issue for this.
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 opened #27933.
|
||
import java.util.List; | ||
|
||
public class ExceptionsHelper { |
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.
Maybe add TODOs for these to be in the core JAR?
* es/master: (45 commits) Adapt scroll rest test after backport. relates #27842 Move early termination based on index sort to TopDocs collector (#27666) Upgrade beats templates that we use for bwc testing. (#27929) ingest: upgraded ingest geoip's geoip2's dependencies. [TEST] logging for update by query test #27820 Add elasticsearch-nio jar for base nio classes (#27801) Use full profile on JDK 10 builds Require Gradle 4.3 Enable grok processor to support long, double and boolean (#27896) Add unreleased v6.1.2 version TEST: reduce blob size #testExecuteMultipartUpload Check index under the store metadata lock (#27768) Fixes DocStats to not report index size < -1 (#27863) Fixed test to be up to date with the new database files. Upgrade to Lucene 7.2.0. (#27910) Disable TestZenDiscovery in cloud providers integrations test Use `_refresh` to shrink the version map on inactivity (#27918) Make KeyedLock reentrant (#27920) ingest: Upgraded the geolite2 databases. [Test] Fix IndicesClientDocumentationIT (#27899) ...
* Splits nio project into two for eclipse build only #27801 introduced a new gradle project `:libs:elasticsearch-nio` which creates cyclical project dependencies when importingthe projects into Eclipse. This change applies the same trick as we have for the core project where, and building for Eclipse, splits the `:libs:elasticsearch-nio` project into `:libs:elasticsearch-nio` which points to `src/main` and `:libs:elasticsearch-nio-tests` which points to `src/test`. This prevents cyclical project dependencies in Eclipse arising from the fact that eclipse does not separate compile/runtime dependencies from test dependencies. * Removes integTest bits since there are none
This is related to #27802. This commit adds a jar called
elasticsearch-nio that contains the base nio classes that will be used
for the tcp nio transport and eventually the http nio transport.
The jar does not depend on elasticsearch:core, so all references to core
have been removed.