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 9f63320 [ZEPPELIN-4148]. Move GitNotebookRepo into zeppelin-zengine as default NotebookRepo 9f63320 is described below commit 9f63320fd5099bb124ce5321cc571cd0799b88aa Author: Jeff Zhang <zjf...@apache.org> AuthorDate: Thu May 9 17:48:38 2019 +0800 [ZEPPELIN-4148]. Move GitNotebookRepo into zeppelin-zengine as default NotebookRepo ### What is this PR for? We should make zeppelin-zengine work without building plugins. So it make sense to move `GitNotebookRepo` into zeppelin-zengine as it is also the default NotebookRepo if not specified in `zeppelin-site.xml` ### What type of PR is it? [ Improvement ] ### Todos * [ ] - Task ### What is the Jira issue? * https://jira.apache.org/jira/browse/ZEPPELIN-4148 ### 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 #3366 from zjffdu/ZEPPELIN-4148 and squashes the following commits: 5c5b2e5ca [Jeff Zhang] [ZEPPELIN-4148]. Move GitNotebookRepo into zeppelin-zengine as default NotebookRepo --- zeppelin-plugins/notebookrepo/git/pom.xml | 79 ---------------------- .../git/src/test/resources/log4j.properties | 50 -------------- zeppelin-plugins/notebookrepo/github/pom.xml | 8 --- zeppelin-plugins/notebookrepo/vfs/pom.xml | 66 ------------------ zeppelin-plugins/pom.xml | 2 - zeppelin-zengine/pom.xml | 20 ++++++ .../zeppelin/notebook/repo/GitNotebookRepo.java | 0 .../zeppelin/notebook/repo/OldGitNotebookRepo.java | 0 .../zeppelin/notebook/repo/OldVFSNotebookRepo.java | 0 .../zeppelin/notebook/repo/VFSNotebookRepo.java | 0 .../org/apache/zeppelin/plugin/PluginManager.java | 19 +++--- .../notebook/repo/GitNotebookRepoTest.java | 5 +- .../repo/NotebookRepoSyncInitializationTest.java | 0 .../notebook/repo/NotebookRepoSyncTest.java | 0 .../notebook/repo/VFSNotebookRepoTest.java | 0 .../notebook/repo/mock/VFSNotebookRepoMock.java | 0 .../notebook/my_project/my_note1_2A94M5J1Z.zpln | 0 .../notebook/my_project/my_note2_2A94M5J2Z.zpln | 0 18 files changed, 31 insertions(+), 218 deletions(-) diff --git a/zeppelin-plugins/notebookrepo/git/pom.xml b/zeppelin-plugins/notebookrepo/git/pom.xml deleted file mode 100644 index 6f75502..0000000 --- a/zeppelin-plugins/notebookrepo/git/pom.xml +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one or more - ~ contributor license agreements. See the NOTICE file distributed with - ~ this work for additional information regarding copyright ownership. - ~ The ASF licenses this file to You under the Apache License, Version 2.0 - ~ (the "License"); you may not use this file except in compliance with - ~ the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License. - --> - -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <artifactId>zengine-plugins-parent</artifactId> - <groupId>org.apache.zeppelin</groupId> - <version>0.9.0-SNAPSHOT</version> - <relativePath>../../../zeppelin-plugins</relativePath> - </parent> - - <groupId>org.apache.zeppelin</groupId> - <artifactId>notebookrepo-git</artifactId> - <packaging>jar</packaging> - <version>0.9.0-SNAPSHOT</version> - <name>Zeppelin: Plugin GitNotebookRepo</name> - <description>NotebookRepo implementation based on Git</description> - - <properties> - <eclipse.jgit.version>4.5.4.201711221230-r</eclipse.jgit.version> - <google.truth.version>0.27</google.truth.version> - <plugin.name>NotebookRepo/GitNotebookRepo</plugin.name> - </properties> - - <dependencies> - <dependency> - <groupId>org.apache.zeppelin</groupId> - <artifactId>notebookrepo-vfs</artifactId> - <version>${project.version}</version> - </dependency> - - <dependency> - <groupId>org.eclipse.jgit</groupId> - <artifactId>org.eclipse.jgit</artifactId> - <version>${eclipse.jgit.version}</version> - </dependency> - - <dependency> - <groupId>com.google.truth</groupId> - <artifactId>truth</artifactId> - <version>${google.truth.version}</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>com.google.guava</groupId> - <artifactId>guava</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <artifactId>maven-dependency-plugin</artifactId> - </plugin> - </plugins> - </build> -</project> diff --git a/zeppelin-plugins/notebookrepo/git/src/test/resources/log4j.properties b/zeppelin-plugins/notebookrepo/git/src/test/resources/log4j.properties deleted file mode 100644 index 661632b..0000000 --- a/zeppelin-plugins/notebookrepo/git/src/test/resources/log4j.properties +++ /dev/null @@ -1,50 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# Direct log messages to stdout -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.Target=System.out -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c:%L - %m%n -#log4j.appender.stdout.layout.ConversionPattern= -#%5p [%t] (%F:%L) - %m%n -#%-4r [%t] %-5p %c %x - %m%n -# - -# Root logger option -log4j.rootLogger=INFO, stdout - -log4j.logger.org.apache.zeppelin.notebook.repo=DEBUG - -#mute some noisy guys -log4j.logger.org.apache.hadoop.mapred=WARN -log4j.logger.org.apache.hadoop.hive.ql=WARN -log4j.logger.org.apache.hadoop.hive.metastore=WARN -log4j.logger.org.apache.haadoop.hive.service.HiveServer=WARN - -log4j.logger.org.quartz=WARN -log4j.logger.DataNucleus=WARN -log4j.logger.DataNucleus.MetaData=ERROR -log4j.logger.DataNucleus.Datastore=ERROR - -# Log all JDBC parameters -log4j.logger.org.hibernate.type=ALL - -log4j.logger.org.apache.zeppelin.interpreter=DEBUG -log4j.logger.org.apache.zeppelin.scheduler=DEBUG -log4j.logger.org.apache.zeppelin.plugin=DEBUG - diff --git a/zeppelin-plugins/notebookrepo/github/pom.xml b/zeppelin-plugins/notebookrepo/github/pom.xml index 5d14003..1fa0cbe 100644 --- a/zeppelin-plugins/notebookrepo/github/pom.xml +++ b/zeppelin-plugins/notebookrepo/github/pom.xml @@ -40,14 +40,6 @@ <plugin.name>NotebookRepo/GitHubNotebookRepo</plugin.name> </properties> - <dependencies> - <dependency> - <groupId>org.apache.zeppelin</groupId> - <artifactId>notebookrepo-git</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> - <build> <plugins> <plugin> diff --git a/zeppelin-plugins/notebookrepo/vfs/pom.xml b/zeppelin-plugins/notebookrepo/vfs/pom.xml deleted file mode 100644 index e23d7bb..0000000 --- a/zeppelin-plugins/notebookrepo/vfs/pom.xml +++ /dev/null @@ -1,66 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one or more - ~ contributor license agreements. See the NOTICE file distributed with - ~ this work for additional information regarding copyright ownership. - ~ The ASF licenses this file to You under the Apache License, Version 2.0 - ~ (the "License"); you may not use this file except in compliance with - ~ the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License. - --> - -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <artifactId>zengine-plugins-parent</artifactId> - <groupId>org.apache.zeppelin</groupId> - <version>0.9.0-SNAPSHOT</version> - <relativePath>../../../zeppelin-plugins</relativePath> - </parent> - - <groupId>org.apache.zeppelin</groupId> - <artifactId>notebookrepo-vfs</artifactId> - <packaging>jar</packaging> - <version>0.9.0-SNAPSHOT</version> - <name>Zeppelin: Plugin VFSNotebookRepo</name> - <description>NotebookRepo implementation based on VFS</description> - - <properties> - <commons.vfs2.version>2.2</commons.vfs2.version> - <plugin.name>NotebookRepo/VFSNotebookRepo</plugin.name> - </properties> - - <dependencies> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-vfs2</artifactId> - <version>${commons.vfs2.version}</version> - <exclusions> - <exclusion> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-utils</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <artifactId>maven-dependency-plugin</artifactId> - </plugin> - </plugins> - </build> - -</project> diff --git a/zeppelin-plugins/pom.xml b/zeppelin-plugins/pom.xml index fc7bd70..66dbc06 100644 --- a/zeppelin-plugins/pom.xml +++ b/zeppelin-plugins/pom.xml @@ -38,8 +38,6 @@ <modules> <module>notebookrepo/s3</module> - <module>notebookrepo/vfs</module> - <module>notebookrepo/git</module> <module>notebookrepo/github</module> <module>notebookrepo/azure</module> <module>notebookrepo/gcs</module> diff --git a/zeppelin-zengine/pom.xml b/zeppelin-zengine/pom.xml index 0b38c58..af5c943 100644 --- a/zeppelin-zengine/pom.xml +++ b/zeppelin-zengine/pom.xml @@ -45,6 +45,8 @@ <xml.apis.version>1.4.01</xml.apis.version> <frontend.maven.plugin.version>1.3</frontend.maven.plugin.version> <aws.sdk.s3.version>1.10.62</aws.sdk.s3.version> + <commons.vfs2.version>2.2</commons.vfs2.version> + <eclipse.jgit.version>4.5.4.201711221230-r</eclipse.jgit.version> <!--test library versions--> <google.truth.version>0.27</google.truth.version> <google.testing.nio.version>0.32.0-alpha</google.testing.nio.version> @@ -178,6 +180,24 @@ </dependency> <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-vfs2</artifactId> + <version>${commons.vfs2.version}</version> + <exclusions> + <exclusion> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>org.eclipse.jgit</groupId> + <artifactId>org.eclipse.jgit</artifactId> + <version>${eclipse.jgit.version}</version> + </dependency> + + <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> diff --git a/zeppelin-plugins/notebookrepo/git/src/main/java/org/apache/zeppelin/notebook/repo/GitNotebookRepo.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/GitNotebookRepo.java similarity index 100% rename from zeppelin-plugins/notebookrepo/git/src/main/java/org/apache/zeppelin/notebook/repo/GitNotebookRepo.java rename to zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/GitNotebookRepo.java diff --git a/zeppelin-plugins/notebookrepo/git/src/main/java/org/apache/zeppelin/notebook/repo/OldGitNotebookRepo.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/OldGitNotebookRepo.java similarity index 100% rename from zeppelin-plugins/notebookrepo/git/src/main/java/org/apache/zeppelin/notebook/repo/OldGitNotebookRepo.java rename to zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/OldGitNotebookRepo.java diff --git a/zeppelin-plugins/notebookrepo/vfs/src/main/java/org/apache/zeppelin/notebook/repo/OldVFSNotebookRepo.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/OldVFSNotebookRepo.java similarity index 100% rename from zeppelin-plugins/notebookrepo/vfs/src/main/java/org/apache/zeppelin/notebook/repo/OldVFSNotebookRepo.java rename to zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/OldVFSNotebookRepo.java diff --git a/zeppelin-plugins/notebookrepo/vfs/src/main/java/org/apache/zeppelin/notebook/repo/VFSNotebookRepo.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/VFSNotebookRepo.java similarity index 100% rename from zeppelin-plugins/notebookrepo/vfs/src/main/java/org/apache/zeppelin/notebook/repo/VFSNotebookRepo.java rename to zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/VFSNotebookRepo.java 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 6f9b0e9..5f715c9 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 @@ -58,17 +58,14 @@ public class PluginManager { public NotebookRepo loadNotebookRepo(String notebookRepoClassName) throws IOException { LOGGER.info("Loading NotebookRepo 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 { - NotebookRepo notebookRepo = (NotebookRepo) - (Class.forName(notebookRepoClassName).newInstance()); - return notebookRepo; - } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { - LOGGER.warn("Fail to instantiate notebookrepo from classpath directly:" + notebookRepoClassName, e); - } + // 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 { + NotebookRepo notebookRepo = (NotebookRepo) + (Class.forName(notebookRepoClassName).newInstance()); + return notebookRepo; + } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { + LOGGER.warn("Fail to instantiate notebookrepo from classpath directly:" + notebookRepoClassName, e); } String simpleClassName = notebookRepoClassName.substring(notebookRepoClassName.lastIndexOf(".") + 1); diff --git a/zeppelin-plugins/notebookrepo/git/src/test/java/org/apache/zeppelin/notebook/repo/GitNotebookRepoTest.java b/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/GitNotebookRepoTest.java similarity index 99% rename from zeppelin-plugins/notebookrepo/git/src/test/java/org/apache/zeppelin/notebook/repo/GitNotebookRepoTest.java rename to zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/GitNotebookRepoTest.java index 6c30e42..a9fa151 100644 --- a/zeppelin-plugins/notebookrepo/git/src/test/java/org/apache/zeppelin/notebook/repo/GitNotebookRepoTest.java +++ b/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/GitNotebookRepoTest.java @@ -25,6 +25,7 @@ import java.io.IOException; import java.util.List; import java.util.Map; +import com.google.common.truth.Truth; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; import org.apache.zeppelin.conf.ZeppelinConfiguration; @@ -99,14 +100,14 @@ public class GitNotebookRepoTest { //then Git git = notebookRepo.getGit(); - assertThat(git).isNotNull(); + Truth.assertThat(git).isNotNull(); assertThat(dotGit.exists()).isEqualTo(true); assertThat(notebookRepo.list(null)).isNotEmpty(); List<DiffEntry> diff = git.diff().call(); // no commit, diff isn't empty - assertThat(diff).isNotEmpty(); + Truth.assertThat(diff).isNotEmpty(); } @Test diff --git a/zeppelin-plugins/notebookrepo/git/src/test/java/org/apache/zeppelin/notebook/repo/NotebookRepoSyncInitializationTest.java b/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/NotebookRepoSyncInitializationTest.java similarity index 100% rename from zeppelin-plugins/notebookrepo/git/src/test/java/org/apache/zeppelin/notebook/repo/NotebookRepoSyncInitializationTest.java rename to zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/NotebookRepoSyncInitializationTest.java diff --git a/zeppelin-plugins/notebookrepo/git/src/test/java/org/apache/zeppelin/notebook/repo/NotebookRepoSyncTest.java b/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/NotebookRepoSyncTest.java similarity index 100% rename from zeppelin-plugins/notebookrepo/git/src/test/java/org/apache/zeppelin/notebook/repo/NotebookRepoSyncTest.java rename to zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/NotebookRepoSyncTest.java diff --git a/zeppelin-plugins/notebookrepo/vfs/src/test/java/org/apache/zeppelin/notebook/repo/VFSNotebookRepoTest.java b/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/VFSNotebookRepoTest.java similarity index 100% rename from zeppelin-plugins/notebookrepo/vfs/src/test/java/org/apache/zeppelin/notebook/repo/VFSNotebookRepoTest.java rename to zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/VFSNotebookRepoTest.java diff --git a/zeppelin-plugins/notebookrepo/git/src/test/java/org/apache/zeppelin/notebook/repo/mock/VFSNotebookRepoMock.java b/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/mock/VFSNotebookRepoMock.java similarity index 100% rename from zeppelin-plugins/notebookrepo/git/src/test/java/org/apache/zeppelin/notebook/repo/mock/VFSNotebookRepoMock.java rename to zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/mock/VFSNotebookRepoMock.java diff --git a/zeppelin-plugins/notebookrepo/git/src/test/resources/notebook/my_project/my_note1_2A94M5J1Z.zpln b/zeppelin-zengine/src/test/resources/notebook/my_project/my_note1_2A94M5J1Z.zpln similarity index 100% rename from zeppelin-plugins/notebookrepo/git/src/test/resources/notebook/my_project/my_note1_2A94M5J1Z.zpln rename to zeppelin-zengine/src/test/resources/notebook/my_project/my_note1_2A94M5J1Z.zpln diff --git a/zeppelin-plugins/notebookrepo/git/src/test/resources/notebook/my_project/my_note2_2A94M5J2Z.zpln b/zeppelin-zengine/src/test/resources/notebook/my_project/my_note2_2A94M5J2Z.zpln similarity index 100% rename from zeppelin-plugins/notebookrepo/git/src/test/resources/notebook/my_project/my_note2_2A94M5J2Z.zpln rename to zeppelin-zengine/src/test/resources/notebook/my_project/my_note2_2A94M5J2Z.zpln