Skip to content

Commit

Permalink
Update to Gradle 8.5 (and OpenSearch 2.11.1 baseline)
Browse files Browse the repository at this point in the history
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
  • Loading branch information
reta committed Feb 1, 2024
1 parent 9477c52 commit aae79e3
Show file tree
Hide file tree
Showing 80 changed files with 349 additions and 332 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@ on:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
java:
- 11
- 17
- 21
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17.0
- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: 17.0
java-version: ${{ matrix.java }}

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
Expand Down
8 changes: 7 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ dependencies {
//testImplementation 'org.apache.lucene:lucene-test-framework:${luceneVersion}'
runtimeOnly 'org.locationtech.spatial4j:spatial4j:0.7'
runtimeOnly 'org.locationtech.jts:jts-core:1.15.0'
runtimeOnly 'org.apache.logging.log4j:log4j-core:2.17.1'
runtimeOnly 'org.apache.logging.log4j:log4j-core:2.20.0'
}


Expand Down Expand Up @@ -143,3 +143,9 @@ githubRelease.doFirst {
targetCommitish = 'main'
}
}

tasks.withType(Test) { task ->
if (JavaVersion.current().compareTo(JavaVersion.VERSION_17) > 0) {
task.jvmArgs += ["-Djava.security.manager=allow"]
}
}
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ltrVersion = 2.1.0
opensearchVersion = 2.5.0
luceneVersion = 9.4.2
ow2Version = 9.4
antlrVersion=4.9.3
ltrVersion = 2.11.1
opensearchVersion = 2.11.1
luceneVersion = 9.7.0
ow2Version = 9.6
antlrVersion=4.11.1
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-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
35 changes: 22 additions & 13 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,13 +80,11 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,22 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
1 change: 1 addition & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand Down
1 change: 1 addition & 0 deletions licenses/antlr4-runtime-4.11.1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
069214c1de1960040729702eb58deac8827135e7
1 change: 0 additions & 1 deletion licenses/antlr4-runtime-4.9.3.jar.sha1

This file was deleted.

1 change: 0 additions & 1 deletion licenses/asm-9.4.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions licenses/asm-9.6.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
aa205cf0a06dbd8e04ece91c0b37c3f5d567546a
1 change: 0 additions & 1 deletion licenses/asm-commons-9.4.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions licenses/asm-commons-9.6.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f1a9e5508eff490744144565c47326c8648be309
1 change: 0 additions & 1 deletion licenses/asm-tree-9.4.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions licenses/asm-tree-9.6.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c0cdda9d211e965d2a4448aa3fd86110f2f8c2de
1 change: 0 additions & 1 deletion licenses/lucene-expressions-9.4.2.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions licenses/lucene-expressions-9.7.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
297e1cfade4ef71466cc9d4f361d81807c8dc4c8
4 changes: 2 additions & 2 deletions src/javaRestTest/java/com/o19s/es/ltr/NodeSettingsIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import com.o19s.es.ltr.ranker.LtrRanker;
import org.apache.lucene.util.Accountable;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.unit.ByteSizeUnit;
import org.opensearch.common.unit.ByteSizeValue;
import org.opensearch.core.common.unit.ByteSizeUnit;
import org.opensearch.core.common.unit.ByteSizeValue;

import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ public <FactoryType> FactoryType compile(String scriptName, String scriptSource,
+ "]");
}
// we use the script "source" as the script identifier
ScoreScript.Factory factory = (p, lookup) ->
ScoreScript.Factory factory = (p, lookup, searcher) ->
new ScoreScript.LeafFactory() {
@Override
public ScoreScript newInstance(LeafReaderContext ctx) throws IOException {
return new ScoreScript(p, lookup, ctx) {
return new ScoreScript(p, lookup, searcher, ctx) {
@Override
public double execute(ExplanationHolder explainationHolder) {
// For testing purposes just look for the "terms" key and see if stats were injected
Expand Down Expand Up @@ -239,7 +239,7 @@ public <FactoryType> FactoryType compile(String scriptName, String scriptSource,
}
// we use the script "source" as the script identifier
if (FEATURE_EXTRACTOR.equals(scriptSource)) {
ScoreScript.Factory factory = (p, lookup) ->
ScoreScript.Factory factory = (p, lookup, searcher) ->
new ScoreScript.LeafFactory() {
final Map<String, Float> featureSupplier;
final String dependentFeature;
Expand Down Expand Up @@ -267,7 +267,7 @@ public <FactoryType> FactoryType compile(String scriptName, String scriptSource,

@Override
public ScoreScript newInstance(LeafReaderContext ctx) throws IOException {
return new ScoreScript(p, lookup, ctx) {
return new ScoreScript(p, lookup, searcher, ctx) {
@Override
public double execute(ExplanationHolder explainationHolder ) {
return extraMultiplier == 0.0d ?
Expand All @@ -286,7 +286,7 @@ public boolean needs_score() {
return context.factoryClazz.cast(factory);
}
else if (scriptSource.equals(FEATURE_EXTRACTOR + "_extra_logging")) {
ScoreScript.Factory factory = (p, lookup) ->
ScoreScript.Factory factory = (p, lookup, searcher) ->
new ScoreScript.LeafFactory() {
{
if (!p.containsKey(FEATURE_VECTOR)) {
Expand All @@ -299,7 +299,7 @@ else if (scriptSource.equals(FEATURE_EXTRACTOR + "_extra_logging")) {

@Override
public ScoreScript newInstance(LeafReaderContext ctx) throws IOException {
return new ScoreScript(p, lookup, ctx) {
return new ScoreScript(p, lookup, searcher, ctx) {

@Override
public double execute(ExplanationHolder explanation) {
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/com/o19s/es/explore/ExplorerQueryBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
package com.o19s.es.explore;

import org.apache.lucene.search.Query;
import org.opensearch.common.ParseField;
import org.opensearch.common.ParsingException;
import org.opensearch.common.io.stream.NamedWriteable;
import org.opensearch.common.io.stream.StreamInput;
import org.opensearch.common.io.stream.StreamOutput;
import org.opensearch.common.xcontent.ObjectParser;
import org.opensearch.common.xcontent.XContentBuilder;
import org.opensearch.common.xcontent.XContentParser;
import org.opensearch.core.ParseField;
import org.opensearch.core.common.ParsingException;
import org.opensearch.core.common.io.stream.NamedWriteable;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.xcontent.ObjectParser;
import org.opensearch.core.xcontent.XContentBuilder;
import org.opensearch.core.xcontent.XContentParser;
import org.opensearch.index.query.AbstractQueryBuilder;
import org.opensearch.index.query.QueryBuilder;
import org.opensearch.index.query.QueryRewriteContext;
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/com/o19s/es/ltr/LtrQueryParserPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,25 @@
import org.apache.lucene.analysis.miscellaneous.LengthFilter;
import org.apache.lucene.analysis.ngram.EdgeNGramTokenFilter;
import org.opensearch.action.ActionRequest;
import org.opensearch.action.ActionResponse;
import org.opensearch.core.action.ActionResponse;
import org.opensearch.client.Client;
import org.opensearch.cluster.metadata.IndexNameExpressionResolver;
import org.opensearch.cluster.node.DiscoveryNodes;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.CheckedFunction;
import org.opensearch.common.ParseField;
import org.opensearch.common.io.stream.NamedWriteableRegistry;
import org.opensearch.common.io.stream.NamedWriteableRegistry.Entry;
import org.opensearch.core.ParseField;
import org.opensearch.core.common.io.stream.NamedWriteableRegistry;
import org.opensearch.core.common.io.stream.NamedWriteableRegistry.Entry;
import org.opensearch.common.settings.ClusterSettings;
import org.opensearch.common.settings.IndexScopedSettings;
import org.opensearch.common.settings.Setting;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.settings.SettingsFilter;
import org.opensearch.common.xcontent.NamedXContentRegistry;
import org.opensearch.common.xcontent.XContentParser;
import org.opensearch.core.xcontent.NamedXContentRegistry;
import org.opensearch.core.xcontent.XContentParser;
import org.opensearch.env.Environment;
import org.opensearch.env.NodeEnvironment;
import org.opensearch.index.Index;
import org.opensearch.core.index.Index;
import org.opensearch.index.analysis.PreConfiguredTokenFilter;
import org.opensearch.index.analysis.PreConfiguredTokenizer;
import org.opensearch.plugins.ActionPlugin;
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/o19s/es/ltr/action/AddFeaturesToSetAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
import org.opensearch.action.ActionRequest;
import org.opensearch.action.ActionRequestBuilder;
import org.opensearch.action.ActionRequestValidationException;
import org.opensearch.action.ActionResponse;
import org.opensearch.core.action.ActionResponse;
import org.opensearch.action.ActionType;
import org.opensearch.action.index.IndexResponse;
import org.opensearch.client.OpenSearchClient;
import org.opensearch.common.io.stream.StreamInput;
import org.opensearch.common.io.stream.StreamOutput;
import org.opensearch.common.io.stream.Writeable.Reader;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.common.io.stream.Writeable.Reader;
import org.opensearch.common.xcontent.StatusToXContentObject;
import org.opensearch.common.xcontent.XContentBuilder;
import org.opensearch.rest.RestStatus;
import org.opensearch.core.xcontent.XContentBuilder;
import org.opensearch.core.rest.RestStatus;

import java.io.IOException;
import java.util.List;
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/o19s/es/ltr/action/CachesStatsAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
import org.opensearch.client.OpenSearchClient;
import org.opensearch.cluster.ClusterName;
import org.opensearch.cluster.node.DiscoveryNode;
import org.opensearch.common.io.stream.StreamInput;
import org.opensearch.common.io.stream.StreamOutput;
import org.opensearch.common.io.stream.Writeable;
import org.opensearch.common.xcontent.ToXContent;
import org.opensearch.common.xcontent.XContentBuilder;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.common.io.stream.Writeable;
import org.opensearch.core.xcontent.ToXContent;
import org.opensearch.core.xcontent.XContentBuilder;

import java.io.IOException;
import java.util.HashMap;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/o19s/es/ltr/action/ClearCachesAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
import org.opensearch.client.OpenSearchClient;
import org.opensearch.cluster.ClusterName;
import org.opensearch.cluster.node.DiscoveryNode;
import org.opensearch.common.io.stream.StreamInput;
import org.opensearch.common.io.stream.StreamOutput;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;

import java.io.IOException;
import java.util.List;
import java.util.Objects;
import org.opensearch.common.io.stream.Writeable.Reader;
import org.opensearch.core.common.io.stream.Writeable.Reader;

import static org.opensearch.action.ValidateActions.addValidationError;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
import org.opensearch.action.ActionRequest;
import org.opensearch.action.ActionRequestBuilder;
import org.opensearch.action.ActionRequestValidationException;
import org.opensearch.action.ActionResponse;
import org.opensearch.core.action.ActionResponse;
import org.opensearch.action.ActionType;
import org.opensearch.action.index.IndexResponse;
import org.opensearch.client.OpenSearchClient;
import org.opensearch.common.io.stream.StreamInput;
import org.opensearch.common.io.stream.StreamOutput;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.common.xcontent.StatusToXContentObject;
import org.opensearch.common.xcontent.XContentBuilder;
import org.opensearch.rest.RestStatus;
import org.opensearch.core.xcontent.XContentBuilder;
import org.opensearch.core.rest.RestStatus;

import java.io.IOException;

Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/o19s/es/ltr/action/FeatureStoreAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
import org.opensearch.action.ActionRequest;
import org.opensearch.action.ActionRequestBuilder;
import org.opensearch.action.ActionRequestValidationException;
import org.opensearch.action.ActionResponse;
import org.opensearch.core.action.ActionResponse;
import org.opensearch.action.ActionType;
import org.opensearch.action.index.IndexResponse;
import org.opensearch.client.OpenSearchClient;
import org.opensearch.common.io.stream.StreamInput;
import org.opensearch.common.io.stream.StreamOutput;
import org.opensearch.common.io.stream.Writeable.Reader;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.common.io.stream.Writeable.Reader;
import org.opensearch.common.xcontent.StatusToXContentObject;
import org.opensearch.common.xcontent.XContentBuilder;
import org.opensearch.rest.RestStatus;
import org.opensearch.core.xcontent.XContentBuilder;
import org.opensearch.core.rest.RestStatus;

import java.io.IOException;
import java.util.Objects;
Expand Down
Loading

0 comments on commit aae79e3

Please sign in to comment.