Skip to content
Closed
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
1 change: 0 additions & 1 deletion spark-operator-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ dependencies {
annotationProcessor("io.fabric8:crd-generator-apt:$fabric8Version")

// utils
implementation("org.apache.commons:commons-lang3:$commonsLang3Version")
implementation("commons-io:commons-io:$commonsIOVersion")
implementation("org.projectlombok:lombok:$lombokVersion")
annotationProcessor("org.projectlombok:lombok:$lombokVersion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.apache.commons.lang3.StringUtils;

import org.apache.spark.k8s.operator.spec.ResourceRetainPolicy;
import org.apache.spark.k8s.operator.spec.RestartConfig;
Expand Down Expand Up @@ -109,7 +108,7 @@ public ApplicationStatus terminateOrRestart(
if (currentAttemptSummary.getAttemptInfo().getId() >= restartConfig.getMaxRestartAttempts()) {
String stateMessage =
String.format(EXCEED_MAX_RETRY_ATTEMPT_MESSAGE, restartConfig.getMaxRestartAttempts());
if (StringUtils.isNotEmpty(stateMessageOverride)) {
if (stateMessageOverride != null && !stateMessageOverride.isEmpty()) {
stateMessage += stateMessageOverride;
}
// max number of restart attempt reached
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import io.fabric8.kubernetes.api.model.Pod;
import io.fabric8.kubernetes.api.model.PodBuilder;
import io.fabric8.kubernetes.api.model.PodTemplateSpec;
import org.apache.commons.lang3.StringUtils;

import org.apache.spark.k8s.operator.SparkApplication;
import org.apache.spark.k8s.operator.spec.ApplicationSpec;
Expand Down Expand Up @@ -67,7 +66,8 @@ public static List<ContainerStatus> findDriverMainContainerStatus(
return containerStatusList;
}
Map<String, String> sparkConf = appSpec.getSparkConf();
if (sparkConf == null || StringUtils.isEmpty(sparkConf.get(DRIVER_SPARK_CONTAINER_PROP_KEY))) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since sparkConf == null is always false logically, I removed this.

String key = sparkConf.get(DRIVER_SPARK_CONTAINER_PROP_KEY);
if (key == null || key.isEmpty()) {
return containerStatusList;
}
String mainContainerName = sparkConf.get(DRIVER_SPARK_CONTAINER_PROP_KEY);
Expand Down