Skip to content

Commit ddb5256

Browse files
committed
Set performance-analyzer-rca 2.0.0 baseline JDK version to JDK-21
Signed-off-by: Andriy Redko <[email protected]>
1 parent 4612c6c commit ddb5256

File tree

10 files changed

+35
-57
lines changed

10 files changed

+35
-57
lines changed

.github/workflows/gauntlet-tests-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
matrix:
1818
java:
19-
- 17
19+
- 21
2020
steps:
2121
- name: Set up JDK
2222
uses: actions/setup-java@v1

.github/workflows/gradle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
matrix:
1616
java:
17-
- 17
17+
- 21
1818
fail-fast: false
1919
runs-on: [ubuntu-latest]
2020
name: Building RCA package

build.gradle

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
buildscript {
77

88
ext {
9-
opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")
9+
opensearch_version = System.getProperty("opensearch.version", "3.0.0")
1010
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
1111
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
12-
buildDockerJdkVersion = System.getProperty("build.docker_jdk_ver", "11")
12+
buildDockerJdkVersion = System.getProperty("build.docker_jdk_ver", "21")
1313

1414
// The PA Commons (https://github.com/opensearch-project/performance-analyzer-commons)
1515
// is a library dependency with hardcoded versioning in PA and RCA repos.
16-
paCommonsVersion = "1.6.0"
16+
paCommonsVersion = "2.0.0"
1717

1818
// 3.0.0-SNAPSHOT -> 3.0.0.0-SNAPSHOT
1919
version_tokens = opensearch_version.tokenize('-')
@@ -147,7 +147,7 @@ check {
147147
}
148148

149149
jacoco {
150-
toolVersion = "0.8.11"
150+
toolVersion = "0.8.13"
151151
}
152152

153153
jacocoTestReport {
@@ -262,7 +262,7 @@ tasks.withType(Test) {
262262
jvmArgs('--add-opens=java.base/java.nio.file=ALL-UNNAMED')
263263
jvmArgs('--add-opens=java.base/java.lang=ALL-UNNAMED')
264264
jvmArgs('--add-opens=java.base/java.util=ALL-UNNAMED')
265-
if (JavaVersion.current().compareTo(JavaVersion.VERSION_17) > 0) {
265+
if (JavaVersion.current().compareTo(JavaVersion.VERSION_17) > 0 && JavaVersion.current().compareTo(JavaVersion.VERSION_24) < 0) {
266266
jvmArgs += ["-Djava.security.manager=allow"]
267267
}
268268
}
@@ -282,8 +282,8 @@ task rcaIt(type: Test) {
282282
//testLogging.showStandardStreams = true
283283
}
284284

285-
sourceCompatibility = JavaVersion.VERSION_11
286-
targetCompatibility = JavaVersion.VERSION_11
285+
sourceCompatibility = JavaVersion.VERSION_21
286+
targetCompatibility = JavaVersion.VERSION_21
287287

288288
compileJava {
289289
dependsOn spotlessApply
@@ -333,9 +333,6 @@ tasks.withType(JavaCompile) {
333333
import org.opensearch.gradle.VersionProperties
334334

335335
dependencies {
336-
if (JavaVersion.current() <= JavaVersion.VERSION_1_8) {
337-
implementation files("${System.properties['java.home']}/../lib/tools.jar")
338-
}
339336
def versions = VersionProperties.versions
340337

341338
def commonslangVersion = "${versions.commonslang}"
@@ -359,7 +356,7 @@ dependencies {
359356
implementation 'org.bouncycastle:bcpkix-jdk15to18:1.78.1'
360357
implementation "org.xerial:sqlite-jdbc:${sqliteVersion}"
361358
implementation "com.google.guava:guava:${guavaVersion}"
362-
implementation 'com.google.code.gson:gson:2.9.0'
359+
implementation 'com.google.code.gson:gson:2.13.1'
363360
implementation 'org.checkerframework:checker-qual:3.29.0'
364361
implementation "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}"
365362
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonDataBindVersion}"
@@ -370,8 +367,8 @@ dependencies {
370367
implementation group: 'commons-io', name: 'commons-io', version: '2.14.0'
371368
implementation group: 'com.google.errorprone', name: 'error_prone_annotations', version: '2.9.0'
372369
implementation group: 'com.google.protobuf', name: 'protobuf-java', version: "${protobufVersion}"
373-
implementation 'io.grpc:grpc-netty:1.68.1'
374-
implementation 'io.grpc:grpc-protobuf:1.68.1'
370+
implementation 'io.grpc:grpc-netty:1.17.0'
371+
implementation 'io.grpc:grpc-protobuf:1.72.0'
375372
implementation("io.netty:netty-codec-http2:${nettyVersion}")
376373
implementation("io.netty:netty-handler-proxy:${nettyVersion}")
377374
implementation 'io.grpc:grpc-stub:1.68.1'
@@ -390,7 +387,7 @@ dependencies {
390387
testImplementation group: 'org.powermock', name: 'powermock-module-junit4-common', version: '2.0.2'
391388
testImplementation group: 'org.powermock', name: 'powermock-reflect', version: '2.0.2'
392389
testImplementation group: 'org.javassist', name: 'javassist', version: '3.28.0-GA'
393-
testImplementation group: 'net.bytebuddy', name: 'byte-buddy', version: '1.14.7'
390+
testImplementation group: 'net.bytebuddy', name: 'byte-buddy', version: '1.17.5'
394391
testImplementation group: 'org.objenesis', name: 'objenesis', version: '3.2'
395392
testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1'
396393
testImplementation group: 'org.hamcrest', name: 'hamcrest', version: '2.1'

gradle/wrapper/gradle-wrapper.jar

302 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

gradlew

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,7 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
8890

8991
# Use the maximum available, or set MAX_FD != -1 to use that value.
9092
MAX_FD=maximum
@@ -112,7 +114,7 @@ case "$( uname )" in #(
112114
NONSTOP* ) nonstop=true ;;
113115
esac
114116

115-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
117+
CLASSPATH="\\\"\\\""
116118

117119

118120
# Determine the Java command to use to start the JVM.
@@ -203,15 +205,15 @@ fi
203205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204206

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

211213
set -- \
212214
"-Dorg.gradle.appname=$APP_BASE_NAME" \
213215
-classpath "$CLASSPATH" \
214-
org.gradle.wrapper.GradleWrapperMain \
216+
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
215217
"$@"
216218

217219
# Stop when "xargs" is not available.

gradlew.bat

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
4345
%JAVA_EXE% -version >NUL 2>&1
4446
if %ERRORLEVEL% equ 0 goto execute
4547

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
48+
echo. 1>&2
49+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50+
echo. 1>&2
51+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52+
echo location of your Java installation. 1>&2
5153

5254
goto fail
5355

@@ -57,22 +59,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5759

5860
if exist "%JAVA_EXE%" goto execute
5961

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
62+
echo. 1>&2
63+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64+
echo. 1>&2
65+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66+
echo location of your Java installation. 1>&2
6567

6668
goto fail
6769

6870
:execute
6971
@rem Setup the command line
7072

71-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73+
set CLASSPATH=
7274

7375

7476
@rem Execute Gradle
75-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
77+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
7678

7779
:end
7880
@rem End local scope for the variables with windows NT shell

src/main/java/org/opensearch/performanceanalyzer/PerformanceAnalyzerApp.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,14 +351,10 @@ public static ClientServers createClientServers(
351351
QueryMetricsRequestHandler queryMetricsRequestHandler =
352352
new QueryMetricsRequestHandler(netClient, metricsRestUtil, appContext);
353353
httpServer.createContext(Util.METRICS_QUERY_URL, queryMetricsRequestHandler);
354-
httpServer.createContext(
355-
Util.LEGACY_OPENDISTRO_METRICS_QUERY_URL, queryMetricsRequestHandler);
356354

357355
QueryBatchRequestHandler queryBatchRequestHandler =
358356
new QueryBatchRequestHandler(netClient, metricsRestUtil);
359357
httpServer.createContext(Util.BATCH_METRICS_URL, queryBatchRequestHandler);
360-
httpServer.createContext(
361-
Util.LEGACY_OPENDISTRO_BATCH_METRICS_URL, queryBatchRequestHandler);
362358
}
363359

364360
return new ClientServers(httpServer, netServer, netClient);

src/main/java/org/opensearch/performanceanalyzer/core/Util.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,14 @@ public class Util {
1717
private static final Logger LOG = LogManager.getLogger(Util.class);
1818

1919
public static final String PA_BASE_URL = "/_plugins/_performanceanalyzer";
20-
public static final String LEGACY_OPENDISTRO_PA_BASE_URL = PA_BASE_URL;
2120

2221
public static final String METRICS_QUERY_URL = PA_BASE_URL + "/metrics";
23-
public static final String LEGACY_OPENDISTRO_METRICS_QUERY_URL =
24-
LEGACY_OPENDISTRO_PA_BASE_URL + "/metrics";
2522

2623
public static final String BATCH_METRICS_URL = PA_BASE_URL + "/batch";
27-
public static final String LEGACY_OPENDISTRO_BATCH_METRICS_URL =
28-
LEGACY_OPENDISTRO_PA_BASE_URL + "/batch";
2924

3025
public static final String RCA_QUERY_URL = PA_BASE_URL + "/rca";
31-
public static final String LEGACY_OPENDISTRO_RCA_QUERY_URL =
32-
LEGACY_OPENDISTRO_PA_BASE_URL + "/rca";
3326

3427
public static final String ACTIONS_QUERY_URL = PA_BASE_URL + "/actions";
35-
public static final String LEGACY_OPENDISTRO_ACTIONS_QUERY_URL =
36-
LEGACY_OPENDISTRO_PA_BASE_URL + "/actions";
3728

3829
public static final String OPENSEARCH_HOME = System.getProperty("opensearch.path.home");
3930
public static final String PLUGIN_LOCATION =

src/main/java/org/opensearch/performanceanalyzer/rca/RcaController.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -492,13 +492,6 @@ private void removeRcaRequestHandler() {
492492
} catch (IllegalArgumentException e) {
493493
LOG.debug("Http(s) context for path: {} was not found to remove.", Util.RCA_QUERY_URL);
494494
}
495-
try {
496-
httpServer.removeContext(Util.LEGACY_OPENDISTRO_RCA_QUERY_URL);
497-
} catch (IllegalArgumentException e) {
498-
LOG.debug(
499-
"Http(s) context for path: {} was not found to remove.",
500-
Util.LEGACY_OPENDISTRO_RCA_QUERY_URL);
501-
}
502495
}
503496

504497
public static String getCatClusterManagerUrl() {
@@ -528,13 +521,10 @@ public RCAScheduler getRcaScheduler() {
528521

529522
private void addRcaRequestHandler() {
530523
httpServer.createContext(Util.RCA_QUERY_URL, queryRcaRequestHandler);
531-
httpServer.createContext(Util.LEGACY_OPENDISTRO_RCA_QUERY_URL, queryRcaRequestHandler);
532524
}
533525

534526
private void addActionsRequestHandler() {
535527
httpServer.createContext(Util.ACTIONS_QUERY_URL, queryActionRequestHandler);
536-
httpServer.createContext(
537-
Util.LEGACY_OPENDISTRO_ACTIONS_QUERY_URL, queryActionRequestHandler);
538528
}
539529

540530
public void setDeliberateInterrupt() {

0 commit comments

Comments
 (0)