You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ch...@apache.org on 2022/12/29 07:52:08 UTC

[kyuubi] branch master updated: [KYUUBI #4038][FOLLOWUP] Use globalSparkContext

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

chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 8b3b621e8 [KYUUBI #4038][FOLLOWUP] Use globalSparkContext
8b3b621e8 is described below

commit 8b3b621e8240a8560f9e132240b1884a2bd0b361
Author: zwangsheng <22...@qq.com>
AuthorDate: Thu Dec 29 15:51:59 2022 +0800

    [KYUUBI #4038][FOLLOWUP] Use globalSparkContext
    
    ### _Why are the changes needed?_
    
    Use `globalSparkContext` to simplify the code.
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
    
    Closes #4041 from zwangsheng/improve/diagnostics_deploy_mode_for_k8s_cluster.
    
    Closes #4038
    
    9426944c [zwangsheng] [FOLLOW UP]Improve print diagnostics info in kubernetes cluster deploy-mode
    
    Authored-by: zwangsheng <22...@qq.com>
    Signed-off-by: Cheng Pan <ch...@apache.org>
---
 .../scala/org/apache/kyuubi/engine/spark/KyuubiSparkUtil.scala    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/KyuubiSparkUtil.scala b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/KyuubiSparkUtil.scala
index 48760bda9..2c3e7195c 100644
--- a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/KyuubiSparkUtil.scala
+++ b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/KyuubiSparkUtil.scala
@@ -57,11 +57,11 @@ object KyuubiSparkUtil extends Logging {
   def engineUrl: String = globalSparkContext.getConf.getOption(
     "spark.org.apache.hadoop.yarn.server.webproxy.amfilter.AmIpFilter.param.PROXY_URI_BASES")
     .orElse(globalSparkContext.uiWebUrl).getOrElse("")
-  def deployMode(sc: SparkContext): String = {
-    if (sc.getConf.getBoolean("spark.kubernetes.submitInDriver", false)) {
+  def deployMode: String = {
+    if (globalSparkContext.getConf.getBoolean("spark.kubernetes.submitInDriver", false)) {
       "cluster"
     } else {
-      sc.deployMode
+      globalSparkContext.deployMode
     }
   }
 
@@ -74,7 +74,7 @@ object KyuubiSparkUtil extends Logging {
        |                 application ID: $engineId
        |                 application web UI: $engineUrl
        |                 master: ${sc.master}
-       |                 deploy mode: ${deployMode(sc)}
+       |                 deploy mode: $deployMode
        |                 version: ${sc.version}
        |           Start time: ${LocalDateTime.ofInstant(Instant.ofEpochMilli(sc.startTime), ZoneId.systemDefault)}
        |           User: ${sc.sparkUser}""".stripMargin