zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zjf...@apache.org
Subject zeppelin git commit: ZEPPELIN-3637. Allow custom spark UI url for new spark interpreter
Date Mon, 23 Jul 2018 07:53:19 GMT
Repository: zeppelin
Updated Branches:
  refs/heads/master 4467ac01d -> 30aa87948


ZEPPELIN-3637. Allow custom spark UI url for new spark interpreter

### What is this PR for?
Trivia fix to allow custom spark UI url for new spark interpreter

### What type of PR is it?
[Bug Fix]

### Todos
* [ ] - Task

### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-3637

### How should this be tested?
* CI pass

### Screenshots (if appropriate)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Jeff Zhang <zjffdu@apache.org>

Closes #3083 from zjffdu/ZEPPELIN-3637 and squashes the following commits:

9789e975e [Jeff Zhang] ZEPPELIN-3637. Allow custom spark UI url for new spark interpreter


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/30aa8794
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/30aa8794
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/30aa8794

Branch: refs/heads/master
Commit: 30aa87948f4b92e95a695e95b94e8157fa3af938
Parents: 4467ac0
Author: Jeff Zhang <zjffdu@apache.org>
Authored: Thu Jul 19 08:30:11 2018 +0800
Committer: Jeff Zhang <zjffdu@apache.org>
Committed: Mon Jul 23 15:53:12 2018 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/zeppelin/spark/NewSparkInterpreter.java | 4 ++++
 .../java/org/apache/zeppelin/spark/NewSparkInterpreterTest.java  | 3 +++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/30aa8794/spark/interpreter/src/main/java/org/apache/zeppelin/spark/NewSparkInterpreter.java
----------------------------------------------------------------------
diff --git a/spark/interpreter/src/main/java/org/apache/zeppelin/spark/NewSparkInterpreter.java
b/spark/interpreter/src/main/java/org/apache/zeppelin/spark/NewSparkInterpreter.java
index 17a257c..fa63dce 100644
--- a/spark/interpreter/src/main/java/org/apache/zeppelin/spark/NewSparkInterpreter.java
+++ b/spark/interpreter/src/main/java/org/apache/zeppelin/spark/NewSparkInterpreter.java
@@ -124,6 +124,10 @@ public class NewSparkInterpreter extends AbstractSparkInterpreter {
           Lists.newArrayList("@transient"));
 
       sparkUrl = this.innerInterpreter.sparkUrl();
+      String sparkUrlProp = getProperty("zeppelin.spark.uiWebUrl", "");
+      if (!StringUtils.isBlank(sparkUrlProp)) {
+        sparkUrl = sparkUrlProp;
+      }
       sparkShims = SparkShims.getInstance(sc.version());
       sparkShims.setupSparkListener(sc.master(), sparkUrl, InterpreterContext.get());
     } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/30aa8794/spark/interpreter/src/test/java/org/apache/zeppelin/spark/NewSparkInterpreterTest.java
----------------------------------------------------------------------
diff --git a/spark/interpreter/src/test/java/org/apache/zeppelin/spark/NewSparkInterpreterTest.java
b/spark/interpreter/src/test/java/org/apache/zeppelin/spark/NewSparkInterpreterTest.java
index e9f85fe..a12fb17 100644
--- a/spark/interpreter/src/test/java/org/apache/zeppelin/spark/NewSparkInterpreterTest.java
+++ b/spark/interpreter/src/test/java/org/apache/zeppelin/spark/NewSparkInterpreterTest.java
@@ -76,6 +76,7 @@ public class NewSparkInterpreterTest {
     properties.setProperty("zeppelin.spark.maxResult", "100");
     properties.setProperty("zeppelin.spark.test", "true");
     properties.setProperty("zeppelin.spark.useNew", "true");
+    properties.setProperty("zeppelin.spark.uiWebUrl", "fake_spark_weburl");
 
     InterpreterContext context = InterpreterContext.builder()
         .setInterpreterOut(new InterpreterOutput(null))
@@ -89,6 +90,8 @@ public class NewSparkInterpreterTest {
     interpreter.setInterpreterGroup(mock(InterpreterGroup.class));
     interpreter.open();
 
+    assertEquals("fake_spark_weburl", interpreter.getSparkUIUrl());
+
     InterpreterResult result = interpreter.interpret("val a=\"hello world\"", getInterpreterContext());
     assertEquals(InterpreterResult.Code.SUCCESS, result.code());
     assertEquals("a: String = hello world\n", output);


Mime
View raw message