Skip to content

Commit

Permalink
Migrate plugin to elasticsearch 7.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
clement-tourriere committed Jan 16, 2020
1 parent 4f0d316 commit 7782a33
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 26 deletions.
10 changes: 10 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Fixes integTests for 7.5.1 => https://github.com/elastic/elasticsearch/issues/49787#issuecomment-562720655
import org.elasticsearch.gradle.testclusters.TestClustersPlugin
import org.elasticsearch.gradle.testclusters.TestClustersRegistry

buildscript {
repositories {
mavenLocal()
Expand Down Expand Up @@ -43,3 +47,9 @@ checkstyleTest.enabled = true
dependencyLicenses.enabled = true

thirdPartyAudit.enabled = true

// Fixes integTests for 7.5.1 => https://github.com/elastic/elasticsearch/issues/49787#issuecomment-562720655
TestClustersRegistry registry = project.rootProject.extensions.create("testClustersRegistry", TestClustersRegistry)
TestClustersPlugin.configureClaimClustersHook(project.gradle, registry)
TestClustersPlugin.configureStartClustersHook(project.gradle, registry)
TestClustersPlugin.configureStopClustersHook(project.gradle, registry)
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.4.0
plugin_version = 7.4.0.0
es_version = 7.5.1
plugin_version = 7.5.1.0
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 12 additions & 17 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

Expand All @@ -175,14 +175,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.elasticsearch.common.xcontent.ObjectParser;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.query.QueryShardContext;
import org.elasticsearch.search.aggregations.AggregationBuilder;
import org.elasticsearch.search.aggregations.AggregatorFactories;
import org.elasticsearch.search.aggregations.AggregatorFactory;
Expand All @@ -15,7 +16,6 @@
import org.elasticsearch.search.aggregations.support.ValuesSourceConfig;
import org.elasticsearch.search.aggregations.support.ValuesSourceParserHelper;
import org.elasticsearch.search.aggregations.support.ValuesSourceType;
import org.elasticsearch.search.internal.SearchContext;

import java.io.IOException;
import java.util.Map;
Expand Down Expand Up @@ -66,7 +66,7 @@ protected void innerWriteTo(StreamOutput out) throws IOException {

@Override
protected ValuesSourceAggregatorFactory<ValuesSource.GeoPoint> innerBuild(
SearchContext context,
QueryShardContext context,
ValuesSourceConfig<ValuesSource.GeoPoint> config,
AggregatorFactory parent,
AggregatorFactories.Builder subFactoriesBuilder) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.elasticsearch.common.util.BigArrays;
import org.elasticsearch.common.util.ObjectArray;
import org.elasticsearch.index.fielddata.MultiGeoPointValues;
import org.elasticsearch.index.query.QueryShardContext;
import org.elasticsearch.search.aggregations.Aggregator;
import org.elasticsearch.search.aggregations.AggregatorFactories;
import org.elasticsearch.search.aggregations.AggregatorFactory;
Expand Down Expand Up @@ -109,25 +110,26 @@ public static class Factory extends ValuesSourceAggregatorFactory<ValuesSource.G

protected Factory(
String name, ValuesSourceConfig<ValuesSource.GeoPoint> config,
SearchContext context, AggregatorFactory parent,
QueryShardContext context, AggregatorFactory parent,
AggregatorFactories.Builder subFactoriesBuilder,
Map<String, Object> metaData) throws IOException {
super(name, config, context, parent, subFactoriesBuilder, metaData);
}

@Override
protected Aggregator createUnmapped(
SearchContext searchContext,
Aggregator parent, List<PipelineAggregator> list,
Map<String, Object> metaData) throws IOException {
return new ConvexHullAggregator(name, context, parent, null, list, metaData);
return new ConvexHullAggregator(name, searchContext, parent, null, list, metaData);
}

@Override
protected Aggregator doCreateInternal(
ValuesSource.GeoPoint valuesSource, Aggregator parent,
ValuesSource.GeoPoint valuesSource, SearchContext searchContext, Aggregator parent,
boolean collectsFromSingleBucket, List<PipelineAggregator> list,
Map<String, Object> metaData) throws IOException {
return new ConvexHullAggregator(name, context, parent, valuesSource, list, metaData);
return new ConvexHullAggregator(name, searchContext, parent, valuesSource, list, metaData);
}
}
}

0 comments on commit 7782a33

Please sign in to comment.