You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/02/01 07:19:07 UTC

[GitHub] [spark] Yikun commented on a change in pull request #35345: [SPARK-37145][K8S] Add KubernetesCustomFeatureConfigStep developer api

Yikun commented on a change in pull request #35345:
URL: https://github.com/apache/spark/pull/35345#discussion_r796313882



##########
File path: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesUtils.scala
##########
@@ -381,4 +382,13 @@ object KubernetesUtils extends Logging {
       }
     }
   }
+
+  // Load and init custom feature step according to `className` and `conf`
+  // This method is used by `KubernetesDriverBuilder` and `KubernetesExecutorBuilder`
+  @Since("3.3.0")
+  def loadFeatureStep(conf: KubernetesConf, className: String): KubernetesFeatureConfigStep = {

Review comment:
       > Regarding `KubernetesDriverCustomFeatureConfigStep` I won't introduce the init at all.
   
   `KubernetesDriverCustomFeatureConfigStep` is used for a custom feature step  with base KubernetesConf, can be shared by driver and executor. and previous `KubernetesFeatureConfigStep` can without conf.
   
   So I guess then final look is like below:
   ```scala
           val initializedFeature = feature match {
             // Since 3.3, allow user implements feature with KubernetesExecutorConf
             case e: KubernetesExecutorCustomFeatureConfigStep =>
               e.init(conf)
               Some(e)
             // raise SparkException with wrong type feature step
             case _: KubernetesDriverCustomFeatureConfigStep =>
               None
             // Since 3.3, allow user implements feature with KubernetesConf
             case c: KubernetesCustomFeatureConfigStep =>
               c.init(conf)
               Some(c)
             // Since 3.2, allow user implements feature without config
             case f: KubernetesFeatureConfigStep =>
               Some(f)
             case _ => None
           }
   ```
   
   WDYT?




-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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