Repository: zeppelin Updated Branches: refs/heads/master fa9f88ba4 -> 21dc20d88
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 Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/21dc20d8 Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/21dc20d8 Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/21dc20d8 Branch: refs/heads/master Commit: 21dc20d8864915475f58705d8bc2fc8678c22dbe Parents: fa9f88b 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:04 2018 +0800 ---------------------------------------------------------------------- .../zeppelin/interpreter/InterpreterSettingManager.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/21dc20d8/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