Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ZEPPELIN-1354] [WIP] Inject Services #1361

Closed
wants to merge 35 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5002a15
add guice dependencies
echarles Aug 24, 2016
0fd9096
Merge branch 'master' into inject-services
echarles Aug 25, 2016
1d2b80a
Initial working implemenation of service injection for WebSecurity an…
echarles Aug 25, 2016
28589fb
Merge branch 'master' into inject-services
echarles Aug 25, 2016
3641e5b
temporary comment governator - seems to give issues when zeppelin run…
echarles Aug 25, 2016
da097a7
Revert change made to zeppelin-web/pom.xml
echarles Aug 31, 2016
74adbd4
Fix format
echarles Sep 2, 2016
d855a8b
Merge branch 'master' into inject-services
echarles Sep 2, 2016
ebe7ebb
Automatic message for commit of samedi 18 mars 2017, 11:23:13 (UTC+0000)
echarles Mar 18, 2017
39543de
Merge branch 'master' of https://github.com/apache/zeppelin
echarles Mar 25, 2017
a2ec2f8
Merge branch 'master' into inject-services
echarles Mar 25, 2017
1fd0457
revert back to scala 2.10
echarles Apr 6, 2017
c744e41
Merge branch 'master' into inject-services
echarles Apr 9, 2017
0befa1b
Merge branch 'master' into inject-services
echarles Apr 16, 2017
85e6572
Use com.google.inject.Inject instead of javax.inject.Inject to avoid …
echarles Apr 18, 2017
0a51045
Merge branch 'master' into inject-services
echarles Apr 18, 2017
7836b89
Remove duplicate searchService field
echarles Apr 19, 2017
639d810
Merge branch 'master' into inject-services
echarles Apr 23, 2017
146bf62
merge master
echarles Apr 23, 2017
acdf249
Merge branch 'master' into inject-services
echarles May 3, 2017
724cac3
Merge branch 'master' into inject-services
echarles May 4, 2017
7065f50
fix typo when merging
echarles May 4, 2017
ea644c8
Merge branch 'master' into inject-services
echarles Jun 5, 2017
25d744e
Align to master change
echarles Jun 5, 2017
dff202a
fix compilation issue
echarles Jun 5, 2017
b57ca32
fix compilation issue
echarles Jun 5, 2017
bcd1356
Merge branch 'master' into inject-services
echarles Jul 21, 2017
3254490
update to master
echarles Jul 21, 2017
6139e99
Fix compilation issue:
echarles Jul 21, 2017
da0ede7
fix
echarles Sep 3, 2017
2e6d28f
fix
echarles Sep 3, 2017
7e196d5
Merge branch 'master' into inject-services
echarles Sep 3, 2017
f556dc4
Merge branch 'master' into inject-services
echarles Nov 6, 2017
58dec36
Merge branch 'master' into inject-services
echarles Dec 15, 2017
2831c49
Merge branch 'master' into inject-services
echarles Jan 3, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add guice dependencies
  • Loading branch information
echarles committed Aug 24, 2016

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 5002a1583681cff847c08977e614963a854d8f1b
30 changes: 22 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -94,7 +94,9 @@
<slf4j.version>1.7.10</slf4j.version>
<log4j.version>1.2.17</log4j.version>
<libthrift.version>0.9.2</libthrift.version>
<governator.version>1.14.2</governator.version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like governator is not used (all import are commented), I think it better to remove it instead of having bunch of commented code.

<gson.version>2.2</gson.version>
<guice.version>4.1.0</guice.version>
<guava.version>15.0</guava.version>
<jetty.version>9.2.15.v20160210</jetty.version>

@@ -193,14 +195,6 @@
<version>${guava.version}</version>
</dependency>


<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>

<!-- Apache Shiro -->
<dependency>
<groupId>org.apache.shiro</groupId>
@@ -212,6 +206,26 @@
<artifactId>shiro-web</artifactId>
<version>1.2.3</version>
</dependency>

<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>${guice.version}</version>
</dependency>

<dependency>
<groupId>com.netflix.governator</groupId>
<artifactId>governator</artifactId>
<version>${governator.version}</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>

</dependencies>
</dependencyManagement>

11 changes: 11 additions & 0 deletions zeppelin-server/pom.xml
Original file line number Diff line number Diff line change
@@ -286,6 +286,17 @@
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-web</artifactId>
</dependency>

<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
</dependency>

<dependency>
<groupId>com.netflix.governator</groupId>
<artifactId>governator</artifactId>
</dependency>

</dependencies>

<build>
Original file line number Diff line number Diff line change
@@ -17,10 +17,13 @@

package org.apache.zeppelin.server;

import com.google.inject.Guice;
import com.google.inject.Injector;
import org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet;
import org.apache.zeppelin.conf.ZeppelinConfiguration;
import org.apache.zeppelin.conf.ZeppelinConfiguration.ConfVars;
import org.apache.zeppelin.dep.DependencyResolver;
import org.apache.zeppelin.inject.ZeppelinModule;
import org.apache.zeppelin.interpreter.InterpreterFactory;
import org.apache.zeppelin.notebook.Notebook;
import org.apache.zeppelin.notebook.NotebookAuthorization;
@@ -62,6 +65,7 @@ public class ZeppelinServer extends Application {
public static Notebook notebook;
public static Server jettyWebServer;
public static NotebookServer notebookWsServer;
public static Injector injector;

private SchedulerFactory schedulerFactory;
private InterpreterFactory replFactory;
@@ -93,6 +97,8 @@ public static void main(String[] args) throws InterruptedException {
ZeppelinConfiguration conf = ZeppelinConfiguration.create();
conf.setProperty("args", args);

injector = Guice.createInjector(new ZeppelinModule(conf));

jettyWebServer = setupJettyServer(conf);

ContextHandlerCollection contexts = new ContextHandlerCollection();
Original file line number Diff line number Diff line change
@@ -251,6 +251,14 @@ public boolean getBoolean(String envName, String propertyName, boolean defaultVa
return getBooleanValue(propertyName, defaultValue);
}

public Class<?> getClass(ConfVars c) {
try {
return Class.forName(c.getStringValue());
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
}

public boolean useSsl() {
return getBoolean(ConfVars.ZEPPELIN_SSL);
}
@@ -322,6 +330,10 @@ public String getTrustStorePassword() {
}
}

public Class<?> getZeppelingApiWebFilterClassname() {
return getClass(ConfVars.ZEPPELIN_API_WEB_FILTER_CLASSNAME);
}

public String getNotebookDir() {
return getString(ConfVars.ZEPPELIN_NOTEBOOK_DIR);
}
@@ -536,7 +548,8 @@ public static enum ConfVars {
ZEPPELIN_ALLOWED_ORIGINS("zeppelin.server.allowed.origins", "*"),
ZEPPELIN_ANONYMOUS_ALLOWED("zeppelin.anonymous.allowed", true),
ZEPPELIN_CREDENTIALS_PERSIST("zeppelin.credentials.persist", true),
ZEPPELIN_WEBSOCKET_MAX_TEXT_MESSAGE_SIZE("zeppelin.websocket.max.text.message.size", "1024000");
ZEPPELIN_WEBSOCKET_MAX_TEXT_MESSAGE_SIZE("zeppelin.websocket.max.text.message.size", "1024000"),
ZEPPELIN_API_WEB_FILTER_CLASSNAME("zeppelin.aoi.web.filter", "local-repo");


private String varName;