From 7eb734ce7ec7e78730d28b6f52d0d485e11bbce2 Mon Sep 17 00:00:00 2001 From: Jeff Zhang Date: Thu, 16 Jan 2020 10:41:20 +0800 Subject: [PATCH] [ZEPPELIN-4551]. upgrade-note.sh Plugin GitNotebookRepo doesn't exist --- .../apache/zeppelin/plugin/PluginManager.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/plugin/PluginManager.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/plugin/PluginManager.java index cdcfed09861..032773e452e 100644 --- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/plugin/PluginManager.java +++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/plugin/PluginManager.java @@ -100,17 +100,14 @@ private String getOldNotebookRepoClassName(String notebookRepoClassName) { */ public OldNotebookRepo loadOldNotebookRepo(String notebookRepoClassName) throws IOException { LOGGER.info("Loading OldNotebookRepo Plugin: " + notebookRepoClassName); - // load plugin from classpath directly when it is test. - // otherwise load it from plugin folder - String isTest = System.getenv("IS_ZEPPELIN_TEST"); - if (isTest != null && isTest.equals("true")) { - try { - OldNotebookRepo notebookRepo = (OldNotebookRepo) - (Class.forName(notebookRepoClassName).newInstance()); - return notebookRepo; - } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { - LOGGER.warn("Fail to instantiate notebookrepo from classpath directly:" + notebookRepoClassName); - } + // load plugin from classpath directly first for these builtin NotebookRepo (such as VFSNoteBookRepo + // and GitNotebookRepo). If fails, then try to load it from plugin folder + try { + OldNotebookRepo notebookRepo = (OldNotebookRepo) + (Class.forName(notebookRepoClassName).newInstance()); + return notebookRepo; + } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { + LOGGER.warn("Fail to instantiate notebookrepo from classpath directly:" + notebookRepoClassName); } String simpleClassName = notebookRepoClassName.substring(notebookRepoClassName.lastIndexOf(".") + 1);