You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by fe...@apache.org on 2023/05/05 02:07:29 UTC

[kyuubi] branch master updated: [KYUUBI #4786] Support yarn-client and yarn-cluster for YarnApplicationOperation

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

feiwang 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 07e26a85e [KYUUBI #4786] Support yarn-client and yarn-cluster for YarnApplicationOperation
07e26a85e is described below

commit 07e26a85e0f4e7722a7c37d195e660751efee178
Author: fwang12 <fw...@ebay.com>
AuthorDate: Fri May 5 10:07:22 2023 +0800

    [KYUUBI #4786] Support yarn-client and yarn-cluster for YarnApplicationOperation
    
    ### _Why are the changes needed?_
    
    The spark master might be yarn-client and yarn-cluster
    ### _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.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request
    
    Closes #4786 from turboFei/yarn_client_cluster.
    
    Closes #4786
    
    accab6b81 [fwang12] Support yarn-client and yarn-cluster
    
    Authored-by: fwang12 <fw...@ebay.com>
    Signed-off-by: fwang12 <fw...@ebay.com>
---
 .../org/apache/kyuubi/engine/KubernetesApplicationOperation.scala     | 4 ++--
 .../scala/org/apache/kyuubi/engine/YarnApplicationOperation.scala     | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala
index 83792f52f..c569dc9dc 100644
--- a/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala
+++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala
@@ -17,6 +17,7 @@
 
 package org.apache.kyuubi.engine
 
+import java.util.Locale
 import java.util.concurrent.{ConcurrentHashMap, TimeUnit}
 
 import com.google.common.cache.{Cache, CacheBuilder, RemovalNotification}
@@ -74,8 +75,7 @@ class KubernetesApplicationOperation extends ApplicationOperation with Logging {
 
   override def isSupported(clusterManager: Option[String]): Boolean = {
     // TODO add deploy mode to check whether is supported
-    kubernetesClient != null && clusterManager.nonEmpty &&
-    clusterManager.get.toLowerCase.startsWith("k8s")
+    kubernetesClient != null && clusterManager.exists(_.toLowerCase(Locale.ROOT).startsWith("k8s"))
   }
 
   override def killApplicationByTag(tag: String): KillResponse = {
diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/YarnApplicationOperation.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/YarnApplicationOperation.scala
index 446314208..ea2bf6dcd 100644
--- a/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/YarnApplicationOperation.scala
+++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/YarnApplicationOperation.scala
@@ -17,6 +17,8 @@
 
 package org.apache.kyuubi.engine
 
+import java.util.Locale
+
 import scala.collection.JavaConverters._
 
 import org.apache.hadoop.yarn.api.records.{FinalApplicationStatus, YarnApplicationState}
@@ -46,7 +48,7 @@ class YarnApplicationOperation extends ApplicationOperation with Logging {
   }
 
   override def isSupported(clusterManager: Option[String]): Boolean = {
-    yarnClient != null && clusterManager.nonEmpty && "yarn".equalsIgnoreCase(clusterManager.get)
+    yarnClient != null && clusterManager.exists(_.toLowerCase(Locale.ROOT).startsWith("yarn"))
   }
 
   override def killApplicationByTag(tag: String): KillResponse = {