dongjoon-hyun opened a new pull request, #55483:
URL: https://github.com/apache/spark/pull/55483

   ### What changes were proposed in this pull request?
   
   This PR adds a Java-friendly accessor `getSystemPropertiesAsJavaMap` to 
`KubernetesDriverSpec` that returns `java.util.Map[String, String]` instead of 
the Scala `Map[String, String]` exposed by the case class field.
   
   ```scala
   @Since("4.2.0")
   def getSystemPropertiesAsJavaMap: JMap[String, String] = 
systemProperties.asJava
   ```
   
   The existing Scala field `systemProperties` is kept as-is, so Scala call 
sites such as `KubernetesDriverBuilder` are not affected.
   
   ### Why are the changes needed?
   
   `KubernetesDriverSpec` is annotated as `@DeveloperApi` and is intended to be 
consumed both internally and by the Spark K8s operator. In SPARK 4.2.0, a 
Java-friendly factory `KubernetesDriverSpec.create(...)` was added so Java 
callers can construct the spec with `java.util.List` / `java.util.Map`. 
However, the read path is still asymmetric: `spec.systemProperties` returns 
`scala.collection.immutable.Map`, which is awkward for Java consumers 
(different `get()` / `size()` signatures, requires `JavaConverters` or 
`CollectionConverters` on the caller side).
   
   This change completes the symmetry between construction and access, 
following the existing `SparkConf.getAllAsJavaMap` pattern.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No (new additive API only; no behavior change for existing callers).
   
   ### How was this patch tested?
   
   Pass the CIs with the updated `KubernetesDriverSpecSuite`, which now asserts 
the returned value is a `java.util.Map` and exercises both the populated and 
empty cases.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Opus 4.7 (1M context)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to