mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
ZEPPELIN-804 Refactoring registration mechanism on Interpreters
- Removed a interpreter which fails to initialize
This commit is contained in:
parent
d3436369a7
commit
0d720c02b7
2 changed files with 12 additions and 5 deletions
|
|
@ -111,7 +111,7 @@
|
|||
"description": "Python command to run pyspark with"
|
||||
}
|
||||
}
|
||||
}/*, //
|
||||
},
|
||||
{
|
||||
"interpreterGroup": "spark",
|
||||
"interpreterName": "r",
|
||||
|
|
@ -142,5 +142,5 @@
|
|||
"description": ""
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -177,9 +177,10 @@ public class RemoteInterpreter extends Interpreter {
|
|||
}
|
||||
|
||||
} catch (TException e) {
|
||||
broken = true;
|
||||
logger.error("Failed to create interpreter: {}", getClassName());
|
||||
throw new InterpreterException(e);
|
||||
} finally {
|
||||
// TODO(jongyoul): Fixed it when not all of interpreter in same interpreter group are broken
|
||||
interpreterProcess.releaseClient(client, broken);
|
||||
}
|
||||
}
|
||||
|
|
@ -195,12 +196,18 @@ public class RemoteInterpreter extends Interpreter {
|
|||
synchronized (interpreterGroup) {
|
||||
// initialize all interpreters in this interpreter group
|
||||
List<Interpreter> interpreters = interpreterGroup.get(noteId);
|
||||
for (Interpreter intp : interpreters) {
|
||||
for (Interpreter intp : new ArrayList<>(interpreters)) {
|
||||
Interpreter p = intp;
|
||||
while (p instanceof WrappedInterpreter) {
|
||||
p = ((WrappedInterpreter) p).getInnerInterpreter();
|
||||
}
|
||||
((RemoteInterpreter) p).init();
|
||||
try {
|
||||
((RemoteInterpreter) p).init();
|
||||
} catch (InterpreterException e) {
|
||||
logger.error("Failed to initialize interpreter: {}. Remove it from interpreterGroup",
|
||||
p.getClassName());
|
||||
interpreters.remove(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue