-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ZEPPELIN-1320] Run zeppelin interpreter process as web front end user #1322
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
Changes from all commits
6aafac4
0ab2fe0
2758b7f
862f937
a2fea0c
590032e
787a108
965c8a7
8c324cd
e0a0ccf
55ccce3
cc6c12e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,14 +17,14 @@ | |
|
|
||
| package org.apache.zeppelin.interpreter.remote; | ||
|
|
||
| import java.util.*; | ||
|
|
||
| import com.google.gson.Gson; | ||
| import com.google.gson.reflect.TypeToken; | ||
| import org.apache.thrift.TException; | ||
| import org.apache.zeppelin.display.AngularObject; | ||
| import org.apache.zeppelin.display.AngularObjectRegistry; | ||
| import org.apache.zeppelin.display.GUI; | ||
| import org.apache.zeppelin.helium.ApplicationEventListener; | ||
| import org.apache.zeppelin.display.Input; | ||
| import org.apache.zeppelin.helium.ApplicationEventListener; | ||
| import org.apache.zeppelin.interpreter.*; | ||
| import org.apache.zeppelin.interpreter.InterpreterResult.Type; | ||
| import org.apache.zeppelin.interpreter.thrift.InterpreterCompletion; | ||
|
|
@@ -36,8 +36,7 @@ | |
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| import com.google.gson.Gson; | ||
| import com.google.gson.reflect.TypeToken; | ||
| import java.util.*; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably a nitpick but Zeppelin's Java code conventions discourages usage of wildcard imports. Could you please check all the other changed files to follow this convention as well?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, I'll revert this, and check that my Editor (Intellij Idea) is also configured properly. |
||
|
|
||
| /** | ||
| * Proxy for Interpreter instance that runs on separate process | ||
|
|
@@ -59,20 +58,24 @@ public class RemoteInterpreter extends Interpreter { | |
| private int maxPoolSize; | ||
| private String host; | ||
| private int port; | ||
| private String userName; | ||
| private Boolean isUserImpersonate; | ||
|
|
||
| /** | ||
| * Remote interpreter and manage interpreter process | ||
| */ | ||
| public RemoteInterpreter(Properties property, | ||
| String noteId, | ||
| String className, | ||
| String interpreterRunner, | ||
| String interpreterPath, | ||
| String localRepoPath, | ||
| int connectTimeout, | ||
| int maxPoolSize, | ||
| RemoteInterpreterProcessListener remoteInterpreterProcessListener, | ||
| ApplicationEventListener appListener) { | ||
| String noteId, | ||
| String className, | ||
| String interpreterRunner, | ||
| String interpreterPath, | ||
| String localRepoPath, | ||
| int connectTimeout, | ||
| int maxPoolSize, | ||
| RemoteInterpreterProcessListener remoteInterpreterProcessListener, | ||
| ApplicationEventListener appListener, | ||
| String userName, | ||
| Boolean isUserImpersonate) { | ||
| super(property); | ||
| this.noteId = noteId; | ||
| this.className = className; | ||
|
|
@@ -85,6 +88,8 @@ public RemoteInterpreter(Properties property, | |
| this.maxPoolSize = maxPoolSize; | ||
| this.remoteInterpreterProcessListener = remoteInterpreterProcessListener; | ||
| this.applicationEventListener = appListener; | ||
| this.userName = userName; | ||
| this.isUserImpersonate = isUserImpersonate; | ||
| } | ||
|
|
||
|
|
||
|
|
@@ -100,7 +105,9 @@ public RemoteInterpreter( | |
| int connectTimeout, | ||
| int maxPoolSize, | ||
| RemoteInterpreterProcessListener remoteInterpreterProcessListener, | ||
| ApplicationEventListener appListener) { | ||
| ApplicationEventListener appListener, | ||
| String userName, | ||
| Boolean isUserImpersonate) { | ||
| super(property); | ||
| this.noteId = noteId; | ||
| this.className = className; | ||
|
|
@@ -111,6 +118,8 @@ public RemoteInterpreter( | |
| this.maxPoolSize = maxPoolSize; | ||
| this.remoteInterpreterProcessListener = remoteInterpreterProcessListener; | ||
| this.applicationEventListener = appListener; | ||
| this.userName = userName; | ||
| this.isUserImpersonate = isUserImpersonate; | ||
| } | ||
|
|
||
|
|
||
|
|
@@ -125,7 +134,9 @@ public RemoteInterpreter( | |
| Map<String, String> env, | ||
| int connectTimeout, | ||
| RemoteInterpreterProcessListener remoteInterpreterProcessListener, | ||
| ApplicationEventListener appListener) { | ||
| ApplicationEventListener appListener, | ||
| String userName, | ||
| Boolean isUserImpersonate) { | ||
| super(property); | ||
| this.className = className; | ||
| this.noteId = noteId; | ||
|
|
@@ -138,6 +149,8 @@ public RemoteInterpreter( | |
| this.maxPoolSize = 10; | ||
| this.remoteInterpreterProcessListener = remoteInterpreterProcessListener; | ||
| this.applicationEventListener = appListener; | ||
| this.userName = userName; | ||
| this.isUserImpersonate = isUserImpersonate; | ||
| } | ||
|
|
||
| private Map<String, String> getEnvFromInterpreterProperty(Properties property) { | ||
|
|
@@ -205,7 +218,7 @@ public synchronized void init() { | |
| RemoteInterpreterProcess interpreterProcess = getInterpreterProcess(); | ||
|
|
||
| final InterpreterGroup interpreterGroup = getInterpreterGroup(); | ||
| interpreterProcess.reference(interpreterGroup); | ||
| interpreterProcess.reference(interpreterGroup, userName, isUserImpersonate); | ||
| interpreterProcess.setMaxPoolSize( | ||
| Math.max(this.maxPoolSize, interpreterProcess.getMaxPoolSize())); | ||
| String groupId = interpreterGroup.getId(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This requires the login user must exist in the os account and be able to ssh to localhost. I am not sure whether this is a good way, but just feel the approach is a little strange compared to the impersonation implementation in hadoop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zjffdu yes, I agree, its not as implementation in hadoop, would you recommend something else ?