Skip to content

Commit

Permalink
Upgrade to 7.17.1, add docker files, update readme and clean imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Bapt Abl committed Mar 18, 2022
1 parent 4873d86 commit c3a4caf
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 21 deletions.
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
| --------------------- | -------------- | ---------- |
Expand All @@ -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
-------
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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")

}
}
Expand Down
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -25,7 +25,6 @@

import java.io.IOException;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit c3a4caf

Please sign in to comment.