Skip to content

Commit 331a0bd

Browse files
authored
Update java build and runtime from 17 to 21 (#2265)
* Update java build and runtime from 17 to 21 follow up on #2260
1 parent e485ec8 commit 331a0bd

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

.ci/java-versions.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
# build and test Elasticsearch for this branch. Valid Java versions
77
# are 'java' or 'openjdk' followed by the major release number.
88

9-
ESH_BUILD_JAVA=openjdk17
10-
ESH_RUNTIME_JAVA=openjdk17
9+
ESH_BUILD_JAVA=openjdk21
10+
ESH_RUNTIME_JAVA=openjdk21

mr/src/main/java/org/elasticsearch/hadoop/util/EsMajorVersion.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public class EsMajorVersion implements Serializable {
3636
public static final EsMajorVersion V_6_X = new EsMajorVersion((byte) 6, "6.x");
3737
public static final EsMajorVersion V_7_X = new EsMajorVersion((byte) 7, "7.x");
3838
public static final EsMajorVersion V_8_X = new EsMajorVersion((byte) 8, "8.x");
39-
public static final EsMajorVersion LATEST = V_8_X;
39+
public static final EsMajorVersion V_9_X = new EsMajorVersion((byte) 9, "9.x");
40+
public static final EsMajorVersion LATEST = V_9_X;
4041

4142
public final byte major;
4243
private final String version;
@@ -92,6 +93,9 @@ public static EsMajorVersion parse(String version) {
9293
if (version.startsWith("8.")) {
9394
return new EsMajorVersion((byte) 8, version);
9495
}
96+
if (version.startsWith("9.")) {
97+
return new EsMajorVersion((byte) 9, version);
98+
}
9599
throw new EsHadoopIllegalArgumentException("Unsupported/Unknown Elasticsearch version [" + version + "]." +
96100
"Highest supported version is [" + LATEST.version + "]. You may need to upgrade ES-Hadoop.");
97101
}

mr/src/test/java/org/elasticsearch/hadoop/serialization/CommandTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public class CommandTest {
5959
public static Collection<Object[]> data() {
6060

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

@@ -76,7 +76,8 @@ public static Collection<Object[]> data() {
7676
EsMajorVersion.V_5_X,
7777
EsMajorVersion.V_6_X,
7878
EsMajorVersion.V_7_X,
79-
EsMajorVersion.V_8_X};
79+
EsMajorVersion.V_8_X,
80+
EsMajorVersion.V_9_X};
8081

8182
for (EsMajorVersion version : versions) {
8283
for (boolean asJson : asJsons) {

0 commit comments

Comments
 (0)