Skip to content

Commit 79bc2a9

Browse files
jiangzhoGitHub Enterprise
authored andcommitted
Merge pull request apache#111 from aryaman-das/153290093-adas
Worked on rdar://153290093 (Introduce Java 11 compatible "spark-operator-api" library)
2 parents ac42c41 + bb5e37c commit 79bc2a9

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

build.gradle

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,16 @@ subprojects {
5454
apply plugin: 'eclipse'
5555
apply plugin: 'java'
5656

57-
java {
58-
sourceCompatibility = 17
59-
targetCompatibility = 17
57+
if (project.name.equals("spark-operator-api")) {
58+
java {
59+
sourceCompatibility = 11
60+
targetCompatibility = 11
61+
}
62+
} else {
63+
java {
64+
sourceCompatibility = 17
65+
targetCompatibility = 17
66+
}
6067
}
6168

6269
repositories {

spark-operator-api/src/main/java/org/apache/spark/k8s/operator/spec/RestartPolicy.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,16 @@ public enum RestartPolicy {
2929

3030
public static boolean attemptRestartOnState(
3131
final RestartPolicy policy, final BaseStateSummary stateSummary) {
32-
return switch (policy) {
33-
case Always -> true;
34-
case Never -> false;
35-
case OnFailure -> stateSummary.isFailure();
36-
case OnInfrastructureFailure -> stateSummary.isInfrastructureFailure();
37-
};
32+
switch (policy) {
33+
case Always:
34+
return true;
35+
case Never:
36+
return false;
37+
case OnFailure:
38+
return stateSummary.isFailure();
39+
case OnInfrastructureFailure:
40+
return stateSummary.isInfrastructureFailure();
41+
}
42+
return false;
3843
}
3944
}

0 commit comments

Comments
 (0)