zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jongy...@apache.org
Subject zeppelin git commit: [ZEPPELIN-2096] Conserve class loader after running interpret method
Date Thu, 20 Apr 2017 07:08:29 GMT
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 <jongyoul@gmail.com>

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 <jongyoul@gmail.com>
Authored: Thu Apr 20 01:55:29 2017 +0900
Committer: Jongyoul Lee <jongyoul@gmail.com>
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


Mime
View raw message