From c3a4caf94466c718d5d536aa09d01e8f4c9d4b55 Mon Sep 17 00:00:00 2001 From: Bapt Abl Date: Fri, 18 Mar 2022 19:02:48 +0100 Subject: [PATCH] Upgrade to 7.17.1, add docker files, update readme and clean imports --- README.md | 26 ++++++++++++++++-- build.gradle | 4 +-- docker-compose.yml | 17 ++++++++++++ docker/Dockerfile | 4 +++ gradle.properties | 4 +-- ...y-geo-7.17.0.jar => legacy-geo-7.17.1.jar} | Bin 116741 -> 116752 bytes .../aggregations/metric/ConvexHull.java | 2 +- .../metric/ConvexHullAggregationBuilder.java | 12 ++++---- .../metric/ConvexHullAggregator.java | 5 ++-- .../metric/InternalConvexHull.java | 10 +++---- 10 files changed, 63 insertions(+), 21 deletions(-) create mode 100644 docker-compose.yml create mode 100644 docker/Dockerfile rename libs/{legacy-geo-7.17.0.jar => legacy-geo-7.17.1.jar} (93%) diff --git a/README.md b/README.md index b9464e5..427bf62 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Plugin versions are available for (at least) all minor versions of Elasticsearch The first 3 digits of plugin version is Elasticsearch versioning. The last digit is used for plugin versioning under an elasticsearch version. To install it, launch this command in Elasticsearch directory replacing the url by the correct link for your Elasticsearch version (see table) -`./bin/elasticsearch-plugin install https://github.com/opendatasoft/elasticsearch-aggregation-envelope/releases/download/v7.17.0.0/envelope-aggregation-7.17.0.0.zip` +`./bin/elasticsearch-plugin install https://github.com/opendatasoft/elasticsearch-aggregation-envelope/releases/download/v7.17.1.0/envelope-aggregation-7.17.1.0.zip` | elasticsearch version | plugin version | plugin url | | --------------------- | -------------- | ---------- | @@ -109,9 +109,31 @@ To install it, launch this command in Elasticsearch directory replacing the url | 7.4.0 | 7.4.0.0 | https://github.com/opendatasoft/elasticsearch-aggregation-envelope/releases/download/v7.4.0.0/envelope-aggregation-7.4.0.0.zip | | 7.5.1 | 7.5.1.0 | https://github.com/opendatasoft/elasticsearch-aggregation-envelope/releases/download/v7.5.1.0/envelope-aggregation-7.5.1.0.zip | | 7.6.0 | 7.6.0.0 | https://github.com/opendatasoft/elasticsearch-aggregation-envelope/releases/download/v7.6.0.0/envelope-aggregation-7.6.0.0.zip | -| 7.17.0 | 7.17.0.0 | https://github.com/opendatasoft/elasticsearch-aggregation-envelope/releases/download/v7.17.0.0/envelope-aggregation-7.17.0.0.zip | +| 7.17.1 | 7.17.1.0 | https://github.com/opendatasoft/elasticsearch-aggregation-envelope/releases/download/v7.17.1.0/envelope-aggregation-7.17.1.0.zip | +## Development Environment Setup + +Build the plugin using gradle: +``` shell +./gradlew build +``` + +or +``` shell +./gradlew assemble # (to avoid the test suite) +``` + +Then the following command will start a dockerized ES and will install the previously built plugin: +``` shell +docker-compose up +``` + +Please be careful during development: you'll need to manually rebuild the .zip using `./gradlew build` on each code +change before running `docker-compose` up again. + +> NOTE: In `docker-compose.yml` you can uncomment the debug env and attach a REMOTE JVM on `*:5005` to debug the plugin. + License ------- diff --git a/build.gradle b/build.gradle index 4c189f3..2234dce 100644 --- a/build.gradle +++ b/build.gradle @@ -42,7 +42,7 @@ dependencies { // However this archive is not included in the final plugin bundle, since // legacy geo and its dependencies (JTS) are already present at runtime // with ES (see the jar/manifest rule below) - compileOnly files('libs/legacy-geo-7.17.0.jar') + compileOnly files('libs/legacy-geo-7.17.1.jar') yamlRestTestImplementation "org.elasticsearch.test:framework:${es_version}" yamlRestTestImplementation "org.apache.logging.log4j:log4j-core:2.17.1" @@ -54,7 +54,7 @@ dependencies { jar { manifest { attributes( - "Class-Path": "../../modules/legacy-geo/legacy-geo-7.17.0.jar ../../modules/legacy-geo/jts-core-1.15.0.jar ../../modules/legacy-geo/spatial4j-0.7.jar") + "Class-Path": "../../modules/legacy-geo/legacy-geo-7.17.1.jar ../../modules/legacy-geo/jts-core-1.15.0.jar ../../modules/legacy-geo/spatial4j-0.7.jar") } } diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..33bdcc4 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,17 @@ +version: "3.7" + +services: + elasticsearch-plugin-debug: + build: + context: . + dockerfile: docker/Dockerfile + target: elasticsearch-plugin-debug + environment: + - discovery.type=single-node + # NO DEBUG + - ES_JAVA_OPTS=-Xms512m -Xmx512m + # DEBUG +# - ES_JAVA_OPTS=-Xms512m -Xmx512m -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005 + ports: + - "9200:9200" + - "5005:5005" # DEBUG diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..208eda6 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,4 @@ +FROM docker.elastic.co/elasticsearch/elasticsearch:7.17.1 AS elasticsearch-plugin-debug + +COPY /build/distributions/envelope-aggregation-7.17.1.0.zip /tmp/envelope-aggregation-7.17.1.0.zip +RUN ./bin/elasticsearch-plugin install file:/tmp/envelope-aggregation-7.17.1.0.zip diff --git a/gradle.properties b/gradle.properties index a22475a..d1f3bd7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -es_version = 7.17.0 -plugin_version = 7.17.0.0 +es_version = 7.17.1 +plugin_version = 7.17.1.0 diff --git a/libs/legacy-geo-7.17.0.jar b/libs/legacy-geo-7.17.1.jar similarity index 93% rename from libs/legacy-geo-7.17.0.jar rename to libs/legacy-geo-7.17.1.jar index 07a3f9638d9f990ebe47b276caff2f03e1f7cd68..08d9a78c3351b69c2c37047a7db1e0e0f4d07445 100644 GIT binary patch delta 3113 zcmZuzd0dl68lEA6AV;_)+=NR&q>w5>u_(r+MSiJVr3C~mRM#Q~xms7YQkp7mr3gxt zL8SgrS;11I-2@_+fKpt=16i!%RjMvl3wUf-!2@F>>a!rE-}~oR?esiPU2u_9b6z>m5Cpx-KTZtl!ZpB=2D2o_(n< z*2RbG?zg>jEmmA(YPaWw_0!IWWqxaR+6t=g4oqfCzJJo8<5c9&E7SWfw9hJcZ&sY; z_jmF=dsL|DT;9Jv`tZ+|ymyt}(q}DhMH}yT7b*?v6YF}G7J+P9?kX|vq0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z#v4laS?oE*m?Z46kQy%#XKoB7=8LeCvrrPTLG{kotqyS&%+QUIsZIc#z>^`yUA6uU zrN-E4HtPE)oGrrnC`>M+Px>()xjN!Aq(8%Jn=N=s55vjN-?9QQ3rr?#mC<;u8M=f! zruCz=;gpaK!08YGmf2_k7)qO`X%doA=aYNYbyPN<0Lbm2l2ls+f0SW{9t8jSrcjeF zPU#fGQ94dx!v~)F3G!@-iY>+J#s@O%@6f`u< z{?rxsUwr4eWd;Cm&ILefBT!}TAcPQfv=s)BL3nB+XDZ)F35B4At#Cex892~AYZ9jx z9qd?seIX5f$b){Urrk0dovlR2sd{6}%=&H@~J5de$rN{ClmL%1Q-Zt4Ct-JH?y!vNTu4?wIP{KyFk{u?A~ zgT6$0`oVHk9{e{2O(Lj>D^1zkxB&bwz_EpwZ;<%tk_iS7Xv3<3oYs{TJ_v=Lvq%SqtMZk&xE!2OrWJ`-L+K=e%21pLdLf+^AC;fr z?S!$jaXP7X_(26FEkmB~LN1!yWohoxPSRZYYRVahsyd+u>5{gK*vB@}q=_y|>QQ+W z(MCLh)Dxkw)90ut=z79#J4e`(KhSKi06ZGht3l4Ir~b!119+6USjN7jutPL{$#Pth z?fe_*6t^Fyovbb>BteSsXNzGd%|@kW{3wy}Yq5^s8NaMsukgRgxwsY4c4@|GDH&f) zpICrWtmC(W{>c5MmiTC`L-^4qal(5@F%|VTr<;%U1L%xDbpS~4-z7c(!Fn7L{2w1N BqH_QM diff --git a/src/main/java/org/opendatasoft/elasticsearch/search/aggregations/metric/ConvexHull.java b/src/main/java/org/opendatasoft/elasticsearch/search/aggregations/metric/ConvexHull.java index f008121..0d1d634 100644 --- a/src/main/java/org/opendatasoft/elasticsearch/search/aggregations/metric/ConvexHull.java +++ b/src/main/java/org/opendatasoft/elasticsearch/search/aggregations/metric/ConvexHull.java @@ -1,7 +1,7 @@ package org.opendatasoft.elasticsearch.search.aggregations.metric; -import org.locationtech.jts.geom.Geometry; import org.elasticsearch.search.aggregations.Aggregation; +import org.locationtech.jts.geom.Geometry; public interface ConvexHull extends Aggregation { Geometry getShape(); diff --git a/src/main/java/org/opendatasoft/elasticsearch/search/aggregations/metric/ConvexHullAggregationBuilder.java b/src/main/java/org/opendatasoft/elasticsearch/search/aggregations/metric/ConvexHullAggregationBuilder.java index aa2117e..38cd438 100644 --- a/src/main/java/org/opendatasoft/elasticsearch/search/aggregations/metric/ConvexHullAggregationBuilder.java +++ b/src/main/java/org/opendatasoft/elasticsearch/search/aggregations/metric/ConvexHullAggregationBuilder.java @@ -2,19 +2,19 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.search.aggregations.support.AggregationContext; -import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; -import org.elasticsearch.search.aggregations.support.ValuesSourceType; -import org.elasticsearch.xcontent.ObjectParser; -import org.elasticsearch.xcontent.XContentBuilder; -import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; +import org.elasticsearch.search.aggregations.support.AggregationContext; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; import org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder; import org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory; import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; +import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; +import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/src/main/java/org/opendatasoft/elasticsearch/search/aggregations/metric/ConvexHullAggregator.java b/src/main/java/org/opendatasoft/elasticsearch/search/aggregations/metric/ConvexHullAggregator.java index 0d7ac34..750488c 100644 --- a/src/main/java/org/opendatasoft/elasticsearch/search/aggregations/metric/ConvexHullAggregator.java +++ b/src/main/java/org/opendatasoft/elasticsearch/search/aggregations/metric/ConvexHullAggregator.java @@ -2,11 +2,11 @@ import org.apache.lucene.index.LeafReaderContext; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.core.Releasables; -import org.elasticsearch.legacygeo.builders.ShapeBuilder; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.ObjectArray; +import org.elasticsearch.core.Releasables; import org.elasticsearch.index.fielddata.MultiGeoPointValues; +import org.elasticsearch.legacygeo.builders.ShapeBuilder; import org.elasticsearch.search.aggregations.Aggregator; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -25,7 +25,6 @@ import java.io.IOException; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Set; diff --git a/src/main/java/org/opendatasoft/elasticsearch/search/aggregations/metric/InternalConvexHull.java b/src/main/java/org/opendatasoft/elasticsearch/search/aggregations/metric/InternalConvexHull.java index e1ab6ad..ebaae3c 100644 --- a/src/main/java/org/opendatasoft/elasticsearch/search/aggregations/metric/InternalConvexHull.java +++ b/src/main/java/org/opendatasoft/elasticsearch/search/aggregations/metric/InternalConvexHull.java @@ -1,18 +1,18 @@ package org.opendatasoft.elasticsearch.search.aggregations.metric; +import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.legacygeo.builders.CoordinatesBuilder; import org.elasticsearch.legacygeo.builders.LineStringBuilder; import org.elasticsearch.legacygeo.builders.PointBuilder; import org.elasticsearch.legacygeo.builders.PolygonBuilder; import org.elasticsearch.legacygeo.builders.ShapeBuilder; import org.elasticsearch.legacygeo.parsers.ShapeParser; -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.Geometry; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation; +import org.elasticsearch.xcontent.XContentBuilder; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.Geometry; import java.io.IOException; import java.util.List;