mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Use reflection to call addListener
This commit is contained in:
parent
af7a92530f
commit
5edb6fdba6
1 changed files with 9 additions and 3 deletions
|
|
@ -157,7 +157,13 @@ public class SparkInterpreter extends Interpreter {
|
|||
|
||||
private static JobProgressListener setupListeners(SparkContext context) {
|
||||
JobProgressListener pl = new JobProgressListener(context.getConf());
|
||||
context.listenerBus().addListener(pl);
|
||||
try {
|
||||
Method m = context.listenerBus().getClass().getMethod("addListener", pl.getClass());
|
||||
m.invoke(context.listenerBus(), pl);
|
||||
} catch (NoSuchMethodException | SecurityException | IllegalAccessException
|
||||
| IllegalArgumentException | InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return pl;
|
||||
}
|
||||
|
||||
|
|
@ -272,7 +278,7 @@ public class SparkInterpreter extends Interpreter {
|
|||
}
|
||||
|
||||
//TODO(jongyoul): Move these codes into PySparkInterpreter.java
|
||||
|
||||
|
||||
String pysparkBasePath = getSystemDefault("SPARK_HOME", "spark.home", null);
|
||||
File pysparkPath;
|
||||
if (null == pysparkBasePath) {
|
||||
|
|
@ -607,7 +613,7 @@ public class SparkInterpreter extends Interpreter {
|
|||
String incomplete = "";
|
||||
|
||||
for (int l = 0; l < linesToRun.length; l++) {
|
||||
String s = linesToRun[l];
|
||||
String s = linesToRun[l];
|
||||
// check if next line starts with "." (but not ".." or "./") it is treated as an invocation
|
||||
if (l + 1 < linesToRun.length) {
|
||||
String nextLine = linesToRun[l + 1].trim();
|
||||
|
|
|
|||
Loading…
Reference in a new issue