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 2019/07/03 01:19:28 UTC

[GitHub] [zeppelin] zjffdu commented on a change in pull request #3393: [ZEPPELIN-4214]. Spark Web UI is displayed in the wrong paragraph

zjffdu commented on a change in pull request #3393: [ZEPPELIN-4214]. Spark Web UI is displayed in the wrong paragraph
URL: https://github.com/apache/zeppelin/pull/3393#discussion_r299743794
 
 

 ##########
 File path: spark/spark-shims/src/main/scala/org/apache/zeppelin/spark/SparkShims.java
 ##########
 @@ -96,37 +96,44 @@ public abstract void setupSparkListener(String master,
   public abstract String showDataFrame(Object obj, int maxResult);
 
 
-  protected String getNoteId(String jobgroupId) {
-    int indexOf = jobgroupId.indexOf("-");
-    int secondIndex = jobgroupId.indexOf("-", indexOf + 1);
-    return jobgroupId.substring(indexOf + 1, secondIndex);
-  }
-
-  protected String getParagraphId(String jobgroupId) {
-    int indexOf = jobgroupId.indexOf("-");
-    int secondIndex = jobgroupId.indexOf("-", indexOf + 1);
-    return jobgroupId.substring(secondIndex + 1, jobgroupId.length());
-  }
-
   protected void buildSparkJobUrl(String master,
                                   String sparkWebUrl,
                                   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 jobGroupId = jobProperties.getProperty("spark.jobGroup.id");
 
     Map<String, String> infos = new java.util.HashMap<String, String>();
     infos.put("jobUrl", jobUrl);
     infos.put("label", "SPARK JOB");
     infos.put("tooltip", "View in Spark web UI");
-    infos.put("noteId", context.getNoteId());
-    infos.put("paraId", context.getParagraphId());
 
 Review comment:
   The root cause is that InterpreterContext is never updated, it is always the first paragraph's InterpreterContext, so the spark job url is always displayed in the first paragraph.

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


With regards,
Apache Git Services