Repository: zeppelin Updated Branches: refs/heads/branch-0.8 7187932a9 -> 3078cd47a
ZEPPELIN-3278. Avoid duplicated interpreter setting ### What is this PR for? Straightforward bugfix for ZEPPELIN-3278. Just don't create interpreter setting instance when registering from template. ### What type of PR is it? [Bug Fix] ### Todos * [ ] - Task ### What is the Jira issue? * https://issues.apache.org/jira/browse/ZEPPELIN-3278 ### 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 <zjf...@apache.org> Closes #2824 from zjffdu/ZEPPELIN-3278 and squashes the following commits: 6ece9ca [Jeff Zhang] [ZEPPELIN-3278] Avoid duplicated interpreter setting (cherry picked from commit 21dc20d8864915475f58705d8bc2fc8678c22dbe) Signed-off-by: Jeff Zhang <zjf...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/3078cd47 Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/3078cd47 Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/3078cd47 Branch: refs/heads/branch-0.8 Commit: 3078cd47a39be2c0e4afa9229b6399e19fcae583 Parents: 7187932 Author: Jeff Zhang <zjf...@apache.org> Authored: Fri Mar 2 09:47:56 2018 +0800 Committer: Jeff Zhang <zjf...@apache.org> Committed: Fri Mar 2 15:09:18 2018 +0800 ---------------------------------------------------------------------- .../zeppelin/interpreter/InterpreterSettingManager.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/3078cd47/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSettingManager.java ---------------------------------------------------------------------- diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSettingManager.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSettingManager.java index 0601c6f..711812e 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 @@ -192,13 +192,14 @@ public class InterpreterSettingManager { } /** - * Load interpreter setting from interpreter-setting.json + * Load interpreter setting from interpreter.json */ private void loadFromFile() throws IOException { InterpreterInfoSaving infoSaving = configStorage.loadInterpreterSettings(); if (infoSaving == null) { - // nothing to read + // it is fresh zeppelin instance if there's no interpreter.json, just create interpreter + // setting from interpreterSettingTemplates for (InterpreterSetting interpreterSettingTemplate : interpreterSettingTemplates.values()) { InterpreterSetting interpreterSetting = new InterpreterSetting(interpreterSettingTemplate); initInterpreterSetting(interpreterSetting); @@ -403,14 +404,10 @@ public class InterpreterSettingManager { .setIntepreterSettingManager(this) .create(); - LOGGER.info("Register InterpreterSettingTemplate & Create InterpreterSetting: {}", + LOGGER.info("Register InterpreterSettingTemplate: {}", interpreterSettingTemplate.getName()); interpreterSettingTemplates.put(interpreterSettingTemplate.getName(), interpreterSettingTemplate); - - InterpreterSetting interpreterSetting = new InterpreterSetting(interpreterSettingTemplate); - initInterpreterSetting(interpreterSetting); - interpreterSettings.put(interpreterSetting.getName(), interpreterSetting); } @VisibleForTesting