You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Dongjoon Hyun (Jira)" <ji...@apache.org> on 2022/08/19 17:48:00 UTC

[jira] [Assigned] (SPARK-38582) Introduce `buildEnvVarsWithKV` and `buildEnvVarsWithFieldRef` for `KubernetesUtils` to eliminate duplicate code pattern

     [ https://issues.apache.org/jira/browse/SPARK-38582?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dongjoon Hyun reassigned SPARK-38582:
-------------------------------------

    Assignee: Qian Sun

> Introduce `buildEnvVarsWithKV` and `buildEnvVarsWithFieldRef` for `KubernetesUtils` to eliminate duplicate code pattern
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-38582
>                 URL: https://issues.apache.org/jira/browse/SPARK-38582
>             Project: Spark
>          Issue Type: Improvement
>          Components: Kubernetes
>    Affects Versions: 3.2.1
>            Reporter: Qian Sun
>            Assignee: Qian Sun
>            Priority: Minor
>
> There are many duplicate code patterns in Spark Code:
> {code:java}
> new EnvVarBuilder()
>   .withName(key)
>   .withValue(value)
>   .build() {code}
> {code:java}
> new EnvVarBuilder()
>    .withName(name)
>      .withValueFrom(new EnvVarSourceBuilder()
>        .withNewFieldRef(version, field)
>        .build())
>    .build()
> {code}
>  
> [The assignment statement for executor envVar | https://github.com/apache/spark/blob/branch-3.3/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/BasicExecutorFeatureStep.scala#L123-L185] has 63 lines.  We could introduce _buildEnvVarsWithKV_ and _buildEnvVarsWithFieldRef_ function to simplify the above code patterns.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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