Skip to content

Update java build and runtime from 17 to 21 #2265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .ci/java-versions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
# build and test Elasticsearch for this branch. Valid Java versions
# are 'java' or 'openjdk' followed by the major release number.

ESH_BUILD_JAVA=openjdk17
ESH_RUNTIME_JAVA=openjdk17
ESH_BUILD_JAVA=openjdk21
ESH_RUNTIME_JAVA=openjdk21
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public class EsMajorVersion implements Serializable {
public static final EsMajorVersion V_6_X = new EsMajorVersion((byte) 6, "6.x");
public static final EsMajorVersion V_7_X = new EsMajorVersion((byte) 7, "7.x");
public static final EsMajorVersion V_8_X = new EsMajorVersion((byte) 8, "8.x");
public static final EsMajorVersion LATEST = V_8_X;
public static final EsMajorVersion V_9_X = new EsMajorVersion((byte) 9, "9.x");
public static final EsMajorVersion LATEST = V_9_X;

public final byte major;
private final String version;
Expand Down Expand Up @@ -92,6 +93,9 @@ public static EsMajorVersion parse(String version) {
if (version.startsWith("8.")) {
return new EsMajorVersion((byte) 8, version);
}
if (version.startsWith("9.")) {
return new EsMajorVersion((byte) 9, version);
}
throw new EsHadoopIllegalArgumentException("Unsupported/Unknown Elasticsearch version [" + version + "]." +
"Highest supported version is [" + LATEST.version + "]. You may need to upgrade ES-Hadoop.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class CommandTest {
public static Collection<Object[]> data() {

// make sure all versions are tested. Throw if a new one is seen:
if (EsMajorVersion.LATEST != EsMajorVersion.V_8_X) {
if (EsMajorVersion.LATEST != EsMajorVersion.V_9_X) {
throw new IllegalStateException("CommandTest needs new version updates.");
}

Expand All @@ -76,7 +76,8 @@ public static Collection<Object[]> data() {
EsMajorVersion.V_5_X,
EsMajorVersion.V_6_X,
EsMajorVersion.V_7_X,
EsMajorVersion.V_8_X};
EsMajorVersion.V_8_X,
EsMajorVersion.V_9_X};

for (EsMajorVersion version : versions) {
for (boolean asJson : asJsons) {
Expand Down