You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2026/05/06 02:41:09 UTC

(spark-kubernetes-operator) branch main updated: [SPARK-56735] Improve `SparkClusterResourceSpec` to use Java-friendly `SparkConf` API

This is an automated email from the ASF dual-hosted git repository.

dongjoon-hyun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-kubernetes-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new c963c9f  [SPARK-56735] Improve `SparkClusterResourceSpec` to use Java-friendly `SparkConf` API
c963c9f is described below

commit c963c9f0acfd39d78f3e99809a20076fd2e920bc
Author: Dongjoon Hyun <do...@apache.org>
AuthorDate: Tue May 5 19:41:00 2026 -0700

    [SPARK-56735] Improve `SparkClusterResourceSpec` to use Java-friendly `SparkConf` API
    
    ### What changes were proposed in this pull request?
    
    Use `SparkConf.getAllAsJavaMap()` instead of `SparkConf.getAll()` in `SparkClusterResourceSpec`.
    
    ### Why are the changes needed?
    
    To remove the `scala.Tuple2` dependency in favor of Java's `Map.Entry`.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Pass the CIs.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    Generated-by: Claude Opus 4.7
    
    Closes #657 from dongjoon-hyun/SPARK-56735.
    
    Authored-by: Dongjoon Hyun <do...@apache.org>
    Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
 .../org/apache/spark/k8s/operator/SparkClusterResourceSpec.java     | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/spark-submission-worker/src/main/java/org/apache/spark/k8s/operator/SparkClusterResourceSpec.java b/spark-submission-worker/src/main/java/org/apache/spark/k8s/operator/SparkClusterResourceSpec.java
index 57bbb73..7e99236 100644
--- a/spark-submission-worker/src/main/java/org/apache/spark/k8s/operator/SparkClusterResourceSpec.java
+++ b/spark-submission-worker/src/main/java/org/apache/spark/k8s/operator/SparkClusterResourceSpec.java
@@ -24,8 +24,6 @@ import static org.apache.spark.k8s.operator.Constants.*;
 import java.util.Map;
 import java.util.Optional;
 
-import scala.Tuple2;
-
 import io.fabric8.kubernetes.api.model.ObjectMeta;
 import io.fabric8.kubernetes.api.model.Service;
 import io.fabric8.kubernetes.api.model.ServiceBuilder;
@@ -75,8 +73,8 @@ public class SparkClusterResourceSpec {
     ClusterSpec spec = cluster.getSpec();
     String version = spec.getRuntimeVersions().getSparkVersion();
     StringBuilder options = new StringBuilder();
-    for (Tuple2<String, String> t : conf.getAll()) {
-      options.append(String.format("-D%s=\"%s\" ", t._1, t._2));
+    for (Map.Entry<String, String> e : conf.getAllAsJavaMap().entrySet()) {
+      options.append(String.format("-D%s=\"%s\" ", e.getKey(), e.getValue()));
     }
     MasterSpec masterSpec = spec.getMasterSpec();
     WorkerSpec workerSpec = spec.getWorkerSpec();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org