You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by zj...@apache.org on 2017/11/06 03:17:45 UTC
zeppelin git commit: [MINOR] overwrite get/set username method for LazyOpenInterpreter and RemoteI…
Repository: zeppelin
Updated Branches:
refs/heads/master aa01d9e9a -> 07d1fa228
[MINOR] overwrite get/set username method for LazyOpenInterpreter and RemoteI…
### What is this PR for?
* Remove the username property in class RemoteInterpreter, instead reuse the username property in class Interpreter, to avoid get null value with method getUserName in the super class Interpreter
* Overwrite username get/set method in class LazyOpenInterpreter
### What type of PR is it?
[Improvement]
### Todos
* [ ] - Task
### What is the Jira issue?
* [ZEPPELIN-2981](https://issues.apache.org/jira/browse/ZEPPELIN-2981)
### 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: lei wang <le...@outlook.com>
Closes #2652 from wary/InterpreterUserNameOverwrite and squashes the following commits:
6168f30 [lei wang] overwrite get/set username method for LazyOpenInterpreter and RemoteInterpreter
Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/07d1fa22
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/07d1fa22
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/07d1fa22
Branch: refs/heads/master
Commit: 07d1fa2285a0ab0ca86bd5c8fc9f5eea2edb5409
Parents: aa01d9e
Author: lei wang <le...@outlook.com>
Authored: Mon Nov 6 09:54:25 2017 +0800
Committer: Jeff Zhang <zj...@apache.org>
Committed: Mon Nov 6 11:17:37 2017 +0800
----------------------------------------------------------------------
.../apache/zeppelin/interpreter/LazyOpenInterpreter.java | 10 ++++++++++
.../zeppelin/interpreter/remote/RemoteInterpreter.java | 9 ++++-----
2 files changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/07d1fa22/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/LazyOpenInterpreter.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/LazyOpenInterpreter.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/LazyOpenInterpreter.java
index 8e55c31..ffb8140 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/LazyOpenInterpreter.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/LazyOpenInterpreter.java
@@ -193,4 +193,14 @@ public class LazyOpenInterpreter
public void unregisterHook(String event) {
intp.unregisterHook(event);
}
+
+ @Override
+ public void setUserName(String userName) {
+ this.intp.setUserName(userName);
+ }
+
+ @Override
+ public String getUserName() {
+ return this.intp.getUserName();
+ }
}
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/07d1fa22/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreter.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreter.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreter.java
index a2e3e9b..13fe46a 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreter.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreter.java
@@ -60,7 +60,6 @@ public class RemoteInterpreter extends Interpreter {
private String className;
private String sessionId;
- private String userName;
private FormType formType;
private RemoteInterpreterProcess interpreterProcess;
@@ -80,7 +79,7 @@ public class RemoteInterpreter extends Interpreter {
super(properties);
this.sessionId = sessionId;
this.className = className;
- this.userName = userName;
+ this.setUserName(userName);
this.lifecycleManager = lifecycleManager;
}
@@ -105,7 +104,7 @@ public class RemoteInterpreter extends Interpreter {
this.interpreterProcess = intpGroup.getOrCreateInterpreterProcess();
synchronized (interpreterProcess) {
if (!interpreterProcess.isRunning()) {
- interpreterProcess.start(userName, false);
+ interpreterProcess.start(this.getUserName(), false);
interpreterProcess.getRemoteInterpreterEventPoller()
.setInterpreterProcess(interpreterProcess);
interpreterProcess.getRemoteInterpreterEventPoller().setInterpreterGroup(intpGroup);
@@ -129,7 +128,7 @@ public class RemoteInterpreter extends Interpreter {
// depends on other interpreter. e.g. PySparkInterpreter depends on SparkInterpreter.
// also see method Interpreter.getInterpreterInTheSameSessionByClassName
for (Interpreter interpreter : getInterpreterGroup()
- .getOrCreateSession(userName, sessionId)) {
+ .getOrCreateSession(this.getUserName(), sessionId)) {
try {
((RemoteInterpreter) interpreter).internal_create();
} catch (IOException e) {
@@ -168,7 +167,7 @@ public class RemoteInterpreter extends Interpreter {
public Void call(Client client) throws Exception {
LOGGER.info("Create RemoteInterpreter {}", getClassName());
client.createInterpreter(getInterpreterGroup().getId(), sessionId,
- className, (Map) getProperties(), userName);
+ className, (Map) getProperties(), getUserName());
return null;
}
});