You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by GitBox <gi...@apache.org> on 2021/06/18 21:22:09 UTC

[GitHub] [zeppelin] zjffdu commented on a change in pull request #4142: [ZEPPELIN-5415] Fix flink.webui.yarn.useProxy not working on yarn-application mode

zjffdu commented on a change in pull request #4142:
URL: https://github.com/apache/zeppelin/pull/4142#discussion_r654169553



##########
File path: flink/flink-scala-parent/src/main/scala/org/apache/zeppelin/flink/FlinkScalaInterpreter.scala
##########
@@ -318,6 +318,12 @@ abstract class FlinkScalaInterpreter(val properties: Properties,
             LOGGER.info("Use FlinkCluster in yarn application mode, appId: {}", yarnAppId)
             this.jmWebUrl = "http://localhost:" + HadoopUtils.getFlinkRestPort(yarnAppId)
             this.displayedJMWebUrl = HadoopUtils.getYarnAppTrackingUrl(yarnAppId)
+            if (properties.getProperty("flink.webui.yarn.useProxy", "false").toBoolean) {
+              val yarnAddress = properties.getProperty("flink.webui.yarn.address")
+              if (!StringUtils.isBlank(yarnAddress)) {

Review comment:
       It is better to extract one method for both yarn mode and yarn-application to avoid code duplication

##########
File path: flink/flink-scala-parent/src/main/scala/org/apache/zeppelin/flink/FlinkScalaInterpreter.scala
##########
@@ -843,6 +843,18 @@ abstract class FlinkScalaInterpreter(val properties: Properties,
     })
   }
 
+  private def isYarnUseProxy(): Boolean = {
+    properties.getProperty("flink.webui.yarn.useProxy", "false").toBoolean
+  }
+
+  private def getJmWebUrlUnderProxy(): String = {
+    // for some cloud vender, the yarn address may be mapped to some other address.
+    val yarnAddress = properties.getProperty("flink.webui.yarn.address")
+    if (StringUtils.isNotBlank(yarnAddress)) {

Review comment:
       no return value if it is false




-- 
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