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 7afdd1e [ZEPPELIN-4899]. Injected variables in ZeppelinServer are lazy loaded 7afdd1e is described below commit 7afdd1e06e5e0a7d07f7c3b0b5410c894bbf8352 Author: Jeff Zhang <zjf...@apache.org> AuthorDate: Mon Jun 22 00:11:58 2020 +0800 [ZEPPELIN-4899]. Injected variables in ZeppelinServer are lazy loaded ### What is this PR for? Trivial PR to create these injected variables when starting zeppelin server. Now these variables are 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. ### What type of PR is it? [Improvement ] ### Todos * [ ] - Task ### What is the Jira issue? * https://issues.apache.org/jira/browse/ZEPPELIN-4899 ### 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 #3816 from zjffdu/ZEPPELIN-4899 and squashes the following commits: 32e47278e [Jeff Zhang] [ZEPPELIN-4899]. Injected variables in ZeppelinServer are lazy loaded (cherry picked from commit 22ff37b66526a25feecf8cc6fa75527db808b1d9) Signed-off-by: Jeff Zhang <zjf...@apache.org> --- .../src/main/java/org/apache/zeppelin/server/ZeppelinServer.java | 5 +++++ 1 file changed, 5 insertions(+) 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 41f3645..b0a33d2 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 @@ -264,6 +264,11 @@ public class ZeppelinServer extends ResourceConfig { Runtime.getRuntime().addShutdownHook(shutdown(conf)); + // 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. + sharedServiceLocator.getService(Notebook.class); + // when zeppelin is started inside of ide (especially for eclipse) // for graceful shutdown, input any key in console window if (System.getenv("ZEPPELIN_IDENT_STRING") == null) {