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 2019/05/17 03:22:40 UTC

[GitHub] [spark] dongjoon-hyun commented on a change in pull request #24630: [SPARK-27754][K8S] Introduce config for driver request cores

dongjoon-hyun commented on a change in pull request #24630: [SPARK-27754][K8S] Introduce config for driver request cores
URL: https://github.com/apache/spark/pull/24630#discussion_r284966698
 
 

 ##########
 File path: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/BasicDriverFeatureStep.scala
 ##########
 @@ -44,6 +44,11 @@ private[spark] class BasicDriverFeatureStep(conf: KubernetesDriverConf)
 
   // CPU settings
   private val driverCpuCores = conf.get(DRIVER_CORES.key, "1")
+  private val driverCoresRequest = if (conf.contains(KUBERNETES_DRIVER_REQUEST_CORES)) {
+    conf.get(KUBERNETES_DRIVER_REQUEST_CORES).get
+  } else {
+    driverCpuCores
+  }
 
 Review comment:
   Thank you for making a PR, @arunmahadevan . Could you rewrite like the following one-liner?
   ```scala
   -  private val driverCoresRequest = if (conf.contains(KUBERNETES_DRIVER_REQUEST_CORES)) {
   -    conf.get(KUBERNETES_DRIVER_REQUEST_CORES).get
   -  } else {
   -    driverCpuCores
   -  }
   +  private val driverCoresRequest = conf.get(KUBERNETES_DRIVER_REQUEST_CORES.key, driverCpuCores)
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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