zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zjf...@apache.org
Subject [zeppelin] branch master updated: [ZEPPELIN-4389]. Add new interpreter if it is newly detected in interpreter folder
Date Tue, 05 Nov 2019 01:31:11 GMT
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 a22eba2  [ZEPPELIN-4389]. Add new interpreter if it is newly detected in interpreter
a22eba2 is described below

commit a22eba24a77ed99f170d54a600fd982c144a29dc
Author: Jeff Zhang <zjffdu@apache.org>
AuthorDate: Wed Oct 23 13:15:00 2019 +0800

    [ZEPPELIN-4389]. Add new interpreter if it is newly detected in interpreter folder
    ### What is this PR for?
    For now, if we put or build new interpreter for zeppelin in `ZEPPELIN_HOME/interpreter`
folder, it won't be created automatically, user have to manually create new interpreter in
interpreter page.
    This PR is to create the newly detected interpreter automatically for user.
    ### What type of PR is it?
    ### Todos
    * [ ] - Task
    ### What is the Jira issue?
    * https://issues.apache.org/jira/browse/ZEPPELIN-4389
    ### How should this be tested?
    * Manually tested.
    Build a fresh new zeppelin without building shell interpreter, and then start it, no shell
interpreter in the interpreter setting page. Then build a new shell interpreter and restart
it, shell interpreter is displayed in the interpreter setting page.
    ### 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 #3493 from zjffdu/ZEPPELIN-4389 and squashes the following commits:
    320108826 [Jeff Zhang] [ZEPPELIN-4389]. Add new interpreter if it is newly detected in
interpreter folder
 .../apache/zeppelin/interpreter/InterpreterSettingManager.java   | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSettingManager.java
index 5104417..c051d8b 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSettingManager.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSettingManager.java
@@ -289,6 +289,15 @@ public class InterpreterSettingManager implements NoteEventListener,
       interpreterSettings.put(savedInterpreterSetting.getId(), savedInterpreterSetting);
+    for (InterpreterSetting interpreterSettingTemplate : interpreterSettingTemplates.values())
+      InterpreterSetting interpreterSetting = new InterpreterSetting(interpreterSettingTemplate);
+      initInterpreterSetting(interpreterSetting);
+      // add newly detected interpreter if it doesn't exist in interpreter.json
+      if (!interpreterSettings.containsKey(interpreterSetting.getId())) {
+        interpreterSettings.put(interpreterSetting.getId(), interpreterSetting);
+      }
+    }
     if (infoSaving.interpreterRepositories != null) {
       for (RemoteRepository repo : infoSaving.interpreterRepositories) {
         if (!dependencyResolver.getRepos().contains(repo)) {

View raw message