You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by jo...@apache.org on 2016/10/22 16:25:49 UTC

zeppelin git commit: [ZEPPELIN-1488] JDBC Interpreter throws error while the interpreter is downloading dependencies

Repository: zeppelin
Updated Branches:
  refs/heads/master 8af7856fd -> 5cc7cc56c


[ZEPPELIN-1488]  JDBC Interpreter throws error while the interpreter is downloading dependencies

### What is this PR for?
For first time, when we add dependencies for JDBC interpreter, dependencies will start getting downloaded in background. During that time, if user runs a paragraph of JDBC interpreter now user getting error , But instead paragraph execution should be put on 'PENDING' state and wait for dependencies to get downloaded and then run the paragraph

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

### Todos

### What is the Jira issue?
[ZEPPELIN-1488] https://issues.apache.org/jira/browse/ZEPPELIN-1488

### How should this be tested?
prerequisites:
1. Any DB setup.(For my testing, i considered hive)
Steps:
1. Delete the local-repo folder under zeppelin project, if it exists
2. Go to interpreter settings page, provide hive connection details under JDBC interprepreter
3. For hive interpreter to run, it needs some dependencies to be added in interpreter settings page
    For hive below dependencies needs to added
    1. org.apache.hive:hive-jdbc:0.14.0
    2. org.apache.hadoop:hadoop-common:2.6.0
4. Once the settings for JDBC interpreter is saved, dependencies will start getting downloaded in background.
5. Run any paragraph with JDBC as interpreter, paragraph should not throw error, status of the paragraph should change to 'pending' while the dependencies are getting downloaded in background.
6. Once the downloading of dependencies is done, the paragraph which were in pending will start executing in order depending on the execution mode of the interpreter (i.e Shared, Scoped, Isolated)

### 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: rajarajan-g <ra...@imaginea.com>

Closes #1467 from rajarajan-g/ZEPPELIN-1488 and squashes the following commits:

b069328 [rajarajan-g] removed unnecessary method call
ee98a84 [rajarajan-g] checkstyle fix
c412dd6 [rajarajan-g] review fix
4f7b938 [rajarajan-g] code fix for ZEPPELIN-1488


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

Branch: refs/heads/master
Commit: 5cc7cc56c59590d7af7f7d199f6a8dca8858a64f
Parents: 8af7856
Author: rajarajan-g <ra...@imaginea.com>
Authored: Tue Oct 18 17:03:40 2016 +0530
Committer: Jongyoul Lee <jo...@apache.org>
Committed: Sun Oct 23 01:25:31 2016 +0900

----------------------------------------------------------------------
 .../src/main/java/org/apache/zeppelin/notebook/Paragraph.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5cc7cc56/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java
index 955ba2d..ad580ed 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java
@@ -293,9 +293,12 @@ public class Paragraph extends Job implements Serializable, Cloneable {
       logger.error("Can not find interpreter name " + repl);
       throw new RuntimeException("Can not find interpreter for " + getRequiredReplName());
     }
-
+    InterpreterSetting intp = getInterpreterSettingById(repl.getInterpreterGroup().getId());
+    while (intp.getStatus().equals(
+      org.apache.zeppelin.interpreter.InterpreterSetting.Status.DOWNLOADING_DEPENDENCIES)) {
+      Thread.sleep(200);
+    }
     if (this.noteHasUser() && this.noteHasInterpreters()) {
-      InterpreterSetting intp = getInterpreterSettingById(repl.getInterpreterGroup().getId());
       if (intp != null &&
         interpreterHasUser(intp) &&
         isUserAuthorizedToAccessInterpreter(intp.getOption()) == false) {