pan3793 commented on code in PR #5168:
URL: https://github.com/apache/kyuubi/pull/5168#discussion_r1295664564
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/spark/SparkProcessBuilder.scala:
##########
@@ -208,6 +210,35 @@ class SparkProcessBuilder(
kubernetesNamespace())
}
+ def appendPodNameConf(conf: Map[String, String]): Map[String, String] = {
+ val map = mutable.Map.newBuilder[String, String]
+ if (clusterManager().exists(cm =>
cm.toLowerCase(Locale.ROOT).startsWith("k8s"))) {
+ getExecutorPodPrefix(conf).foreach { case (k, v) => map += (k, v) }
+ if (deployMode().exists(_.toLowerCase(Locale.ROOT) == "cluster")) {
+ getDriverPodPrefix(conf).foreach { case (k, v) => map += (k, v) }
+ }
+ }
+ map.result().toMap
+ }
+
+ def getDriverPodPrefix(conf: Map[String, String]): Option[(String, String)]
= {
+ conf.get(KUBERNETES_DRIVER_POD_NAME) match {
+ case None => // skip setting if provided
+ val name = KubernetesUtils.generateDriverPodName(conf(APP_KEY),
engineRefId)
+ Some(KUBERNETES_DRIVER_POD_NAME -> name)
+ case _ => None
+ }
+ }
+
+ def getExecutorPodPrefix(conf: Map[String, String]): Option[(String,
String)] = {
+ conf.get(KUBERNETES_EXECUTOR_POD_NAME_PREFIX) match {
+ case None => // skip setting if provided
Review Comment:
```suggestion
case None =>
```
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/spark/SparkProcessBuilder.scala:
##########
@@ -208,6 +210,35 @@ class SparkProcessBuilder(
kubernetesNamespace())
}
+ def appendPodNameConf(conf: Map[String, String]): Map[String, String] = {
+ val map = mutable.Map.newBuilder[String, String]
+ if (clusterManager().exists(cm =>
cm.toLowerCase(Locale.ROOT).startsWith("k8s"))) {
+ getExecutorPodPrefix(conf).foreach { case (k, v) => map += (k, v) }
+ if (deployMode().exists(_.toLowerCase(Locale.ROOT) == "cluster")) {
+ getDriverPodPrefix(conf).foreach { case (k, v) => map += (k, v) }
+ }
+ }
+ map.result().toMap
+ }
+
+ def getDriverPodPrefix(conf: Map[String, String]): Option[(String, String)]
= {
+ conf.get(KUBERNETES_DRIVER_POD_NAME) match {
+ case None => // skip setting if provided
Review Comment:
```suggestion
case None =>
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]