You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by zj...@apache.org on 2020/09/14 04:12:45 UTC
[zeppelin] branch branch-0.9 updated: [ZEPPELIN-5030].
InterpreterSettingManager is created twice
This is an automated email from the ASF dual-hosted git repository.
zjffdu pushed a commit to branch branch-0.9
in repository https://gitbox.apache.org/repos/asf/zeppelin.git
The following commit(s) were added to refs/heads/branch-0.9 by this push:
new 26ddb66 [ZEPPELIN-5030]. InterpreterSettingManager is created twice
26ddb66 is described below
commit 26ddb66337499ea1685b0920677ff834ea3d650e
Author: Jeff Zhang <zj...@apache.org>
AuthorDate: Wed Sep 9 17:58:10 2020 +0800
[ZEPPELIN-5030]. InterpreterSettingManager is created twice
### What is this PR for?
This PR is to fix the issue of creating InterpreterSettingManager twice. Besides that, it also fix a minor bug in InterpreterSettingManager (use continue instead of break)
### What type of PR is it?
[Bug Fix]
### Todos
* [ ] - Task
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-5030
### 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 <zj...@apache.org>
Closes #3899 from zjffdu/ZEPPELIN-5030 and squashes the following commits:
08bc7d4b4 [Jeff Zhang] [ZEPPELIN-5030]. InterpreterSettingManager is created twice
(cherry picked from commit a8d2a997f85568fabe25deb448315b3f111ff9e4)
Signed-off-by: Jeff Zhang <zj...@apache.org>
---
.../org/apache/zeppelin/server/ZeppelinServer.java | 3 ++-
.../main/resources/{shiro.ini => log4j.properties} | 22 ++++------------------
.../interpreter/InterpreterSettingManager.java | 5 +++--
3 files changed, 9 insertions(+), 21 deletions(-)
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java b/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java
index 296abd5..146fec0 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java
@@ -271,7 +271,8 @@ public class ZeppelinServer extends ResourceConfig {
// Try to get Notebook from ServiceLocator, because Notebook instantiation is lazy, it is
// created when user open zeppelin in browser if we don't get it explicitly here.
// Lazy loading will cause paragraph recovery and cron job initialization is delayed.
- Notebook notebook = sharedServiceLocator.getService(Notebook.class);
+ Notebook notebook = ServiceLocatorUtilities.getService(
+ sharedServiceLocator, Notebook.class.getName());
// Try to recover here, don't do it in constructor of Notebook, because it would cause deadlock.
notebook.recoveryIfNecessary();
diff --git a/zeppelin-server/src/main/resources/shiro.ini b/zeppelin-server/src/main/resources/log4j.properties
similarity index 61%
rename from zeppelin-server/src/main/resources/shiro.ini
rename to zeppelin-server/src/main/resources/log4j.properties
index 050c9d9..9ae2772 100644
--- a/zeppelin-server/src/main/resources/shiro.ini
+++ b/zeppelin-server/src/main/resources/log4j.properties
@@ -15,22 +15,8 @@
# limitations under the License.
#
-[users]
-# List of users with their password allowed to access Zeppelin.
-# To use a different strategy (LDAP / Database / ...) check the shiro doc at http://shiro.apache.org/configuration.html#Configuration-INISections
-admin = password, admin
-user1 = user1, role1
+log4j.rootLogger = INFO,stdout
-
-[urls]
-# anon means the access is anonymous.
-# authcBasic means Basic Auth Security
-# To enfore security, comment the line below and uncomment the next one
-/** = anon
-#/** = authc
-
-[roles]
-role1 = *
-role2 = *
-role3 = *
-admin = *
+log4j.appender.stdout = org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%5p [%d] ({%t} %F[%M]:%L) - %m%n
\ No newline at end of file
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 42e747d..a5bfc7a 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
@@ -255,7 +255,7 @@ public class InterpreterSettingManager implements NoteEventListener, ClusterEven
//TODO(zjffdu) still ugly (should move all to InterpreterInfoSaving)
for (InterpreterSetting savedInterpreterSetting : infoSaving.interpreterSettings.values()) {
if (!shouldRegister(savedInterpreterSetting.getGroup())) {
- break;
+ continue;
}
savedInterpreterSetting.setProperties(InterpreterSetting.convertInterpreterProperties(
savedInterpreterSetting.getProperties()
@@ -292,7 +292,7 @@ public class InterpreterSettingManager implements NoteEventListener, ClusterEven
}
}
savedInterpreterSetting.postProcessing();
- LOGGER.info("Create Interpreter Setting {} from interpreter.json",
+ LOGGER.info("Create interpreter setting {} from interpreter.json",
savedInterpreterSetting.getName());
interpreterSettings.put(savedInterpreterSetting.getId(), savedInterpreterSetting);
}
@@ -302,6 +302,7 @@ public class InterpreterSettingManager implements NoteEventListener, ClusterEven
initInterpreterSetting(interpreterSetting);
// add newly detected interpreter if it doesn't exist in interpreter.json
if (!interpreterSettings.containsKey(interpreterSetting.getId())) {
+ LOGGER.info("Create interpreter setting: {} from interpreter setting template", interpreterSetting.getId());
interpreterSettings.put(interpreterSetting.getId(), interpreterSetting);
}
}