This is an automated email from the ASF dual-hosted git repository. zjffdu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/zeppelin.git
The following commit(s) were added to refs/heads/master by this push: new 7c7f59a [ZEPPELIN-5132] Allow job id injection for spark job url when knox is enabled 7c7f59a is described below commit 7c7f59a50429905a75f922b2f7e560379e5f3ed8 Author: Jeff Zhang <zjf...@apache.org> AuthorDate: Fri Nov 13 16:53:08 2020 +0800 [ZEPPELIN-5132] Allow job id injection for spark job url when knox is enabled ### What is this PR for? ### What type of PR is it? [Bug Fix | Improvement | Feature | Documentation | Hot Fix | Refactoring] ### Todos * [ ] - Task ### What is the Jira issue? * Open an issue on Jira https://issues.apache.org/jira/browse/ZEPPELIN/ * Put link here, and add [ZEPPELIN-*Jira number*] in PR title, eg. [ZEPPELIN-533] ### How should this be tested? * First time? Setup Travis CI as described on https://zeppelin.apache.org/contribution/contributions.html#continuous-integration * Strongly recommended: add automated unit tests for any new or changed behavior * Outline any manual steps to test the PR here. ### Screenshots (if appropriate) ### Questions: * Does the licenses files need update? * Is there breaking changes for older versions? * Does this needs documentation? Author: Jeff Zhang <zjf...@apache.org> Closes #3972 from zjffdu/ZEPPELIN-5132 and squashes the following commits: f2b61e465 [Jeff Zhang] [ZEPPELIN-5132] Allow job id injection for spark job url when knox is enabled --- .../main/scala/org/apache/zeppelin/spark/SparkShims.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/spark/spark-shims/src/main/scala/org/apache/zeppelin/spark/SparkShims.java b/spark/spark-shims/src/main/scala/org/apache/zeppelin/spark/SparkShims.java index 306b031..adabbc1 100644 --- a/spark/spark-shims/src/main/scala/org/apache/zeppelin/spark/SparkShims.java +++ b/spark/spark-shims/src/main/scala/org/apache/zeppelin/spark/SparkShims.java @@ -108,11 +108,17 @@ public abstract class SparkShims { int jobId, Properties jobProperties, InterpreterContext context) { - String jobUrl = sparkWebUrl + "/jobs/job?id=" + jobId; - String version = VersionInfo.getVersion(); - if (master.toLowerCase().contains("yarn") && !supportYarn6615(version)) { - jobUrl = sparkWebUrl + "/jobs"; + String jobUrl = null; + if (sparkWebUrl.contains("{jobId}")) { + jobUrl = sparkWebUrl.replace("{jobId}", jobId + ""); + } else { + jobUrl = sparkWebUrl + "/jobs/job?id=" + jobId; + String version = VersionInfo.getVersion(); + if (master.toLowerCase().contains("yarn") && !supportYarn6615(version)) { + jobUrl = sparkWebUrl + "/jobs"; + } } + String jobGroupId = jobProperties.getProperty("spark.jobGroup.id"); Map<String, String> infos = new java.util.HashMap<String, String>();