zeppelin git commit: [ZEPPELIN-2096] Conserve class loader after running interpret method

2017-04-20 Thread jongyoul
Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.7 4dfb81500 -> 840663224


[ZEPPELIN-2096] Conserve class loader after running interpret method

### What is this PR for?
This PR is a follow-up PR of ZEPPELIN-1972. It keep context class loader while 
running interpret method by scala. For more information, please see 
https://issues.apache.org/jira/browse/ZEPPELIN-1972

### What type of PR is it?
[Feature]

### Todos
* [x] - Backup and restore class loader around interpret method.

### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-2096

### How should this be tested?
N/A

### Screenshots (if appropriate)
N/A

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Jongyoul Lee 

Closes #2258 from jongyoul/ZEPPELIN-2096 and squashes the following commits:

1eec19767 [Jongyoul Lee] Added logic to restore class loader after running 
interpret method


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/84066322
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/84066322
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/84066322

Branch: refs/heads/branch-0.7
Commit: 840663224fa20ecdf8f248ed764bdb0473335c9a
Parents: 4dfb815
Author: Jongyoul Lee 
Authored: Thu Apr 20 01:55:29 2017 +0900
Committer: Jongyoul Lee 
Committed: Thu Apr 20 16:08:07 2017 +0900

--
 .../org/apache/zeppelin/interpreter/LazyOpenInterpreter.java  | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/84066322/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 ad85ded..a090dbd 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
@@ -92,7 +92,12 @@ public class LazyOpenInterpreter
   @Override
   public InterpreterResult interpret(String st, InterpreterContext context) {
 open();
-return intp.interpret(st, context);
+ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+try {
+  return intp.interpret(st, context);
+} finally {
+  Thread.currentThread().setContextClassLoader(classLoader);
+}
   }
 
   @Override



zeppelin git commit: [ZEPPELIN-2096] Conserve class loader after running interpret method

2017-04-20 Thread jongyoul
Repository: zeppelin
Updated Branches:
  refs/heads/master 8dd1fb184 -> 652911abe


[ZEPPELIN-2096] Conserve class loader after running interpret method

### What is this PR for?
This PR is a follow-up PR of ZEPPELIN-1972. It keep context class loader while 
running interpret method by scala. For more information, please see 
https://issues.apache.org/jira/browse/ZEPPELIN-1972

### What type of PR is it?
[Feature]

### Todos
* [x] - Backup and restore class loader around interpret method.

### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-2096

### How should this be tested?
N/A

### Screenshots (if appropriate)
N/A

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Jongyoul Lee 

Closes #2258 from jongyoul/ZEPPELIN-2096 and squashes the following commits:

1eec19767 [Jongyoul Lee] Added logic to restore class loader after running 
interpret method


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/652911ab
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/652911ab
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/652911ab

Branch: refs/heads/master
Commit: 652911abe457d48a540be4a3de2dad824691dfb1
Parents: 8dd1fb1
Author: Jongyoul Lee 
Authored: Thu Apr 20 01:55:29 2017 +0900
Committer: Jongyoul Lee 
Committed: Thu Apr 20 16:05:54 2017 +0900

--
 .../org/apache/zeppelin/interpreter/LazyOpenInterpreter.java  | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/652911ab/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 bb09d19..f1cbef8 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
@@ -92,7 +92,12 @@ public class LazyOpenInterpreter
   @Override
   public InterpreterResult interpret(String st, InterpreterContext context) {
 open();
-return intp.interpret(st, context);
+ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+try {
+  return intp.interpret(st, context);
+} finally {
+  Thread.currentThread().setContextClassLoader(classLoader);
+}
   }
 
   @Override