You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/01/23 12:11:57 UTC

[GitHub] [incubator-kyuubi] pan3793 commented on a change in pull request #1827: [KYUUBI #1825] Generate appName for Flink applications

pan3793 commented on a change in pull request #1827:
URL: https://github.com/apache/incubator-kyuubi/pull/1827#discussion_r790267825



##########
File path: externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/FlinkSQLEngine.scala
##########
@@ -72,6 +75,20 @@ object FlinkSQLEngine extends Logging {
     try {
       val flinkConfDir = CliFrontend.getConfigurationDirectoryFromEnv
       val flinkConf = GlobalConfiguration.loadConfiguration(flinkConfDir)
+
+      val executionTarget = flinkConf.getString(DeploymentOptions.TARGET)
+      // set cluster name for per-job and application mode
+      executionTarget match {
+        case "yarn-per-job" | "yarn-application" =>
+          val appName = s"kyuubi_${user}_flink_${Instant.now}"
+          flinkConf.setString("yarn.application.name", appName)
+        case "kubernetes-application" =>
+          val appName = s"kyuubi-${user}-flink-${Instant.now}"
+          flinkConf.setString("kubernetes.cluster-id", appName)
+        case null =>
+          error("No execution.target specified for Flink engine")
+      }

Review comment:
       we need a `case _ =>` branch to handle other cases. BTW, can `executionTarget` be `null`?




-- 
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: commits-unsubscribe@kyuubi.apache.org

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