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 22ff37b  [ZEPPELIN-4899]. Injected variables in ZeppelinServer are 
lazy loaded
22ff37b is described below

commit 22ff37b66526a25feecf8cc6fa75527db808b1d9
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
---
 .../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) {

Reply via email to