mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
minor update
This commit is contained in:
parent
200ca71296
commit
83eaf83f5b
1 changed files with 6 additions and 8 deletions
|
|
@ -168,18 +168,16 @@ public abstract class BaseLivyInterprereter extends Interpreter {
|
|||
@Override
|
||||
public void cancel(InterpreterContext context) {
|
||||
if (livyVersion.isCancelSupported()) {
|
||||
String paraId = context.getParagraphId();
|
||||
Integer stmtId = paragraphId2StmtIdMapping.get(paraId);
|
||||
try {
|
||||
if (paragraphId2StmtIdMapping.containsKey(context.getParagraphId())) {
|
||||
cancelStatement(paragraphId2StmtIdMapping.get(context.getParagraphId()));
|
||||
if (stmtId != null) {
|
||||
cancelStatement(stmtId);
|
||||
}
|
||||
} catch (LivyException e) {
|
||||
LOGGER.error("Fail to cancel statement " +
|
||||
paragraphId2StmtIdMapping.get(context.getParagraphId()) + " for paragraph " +
|
||||
context.getParagraphId(), e);
|
||||
LOGGER.error("Fail to cancel statement " + stmtId + " for paragraph " + paraId, e);
|
||||
} finally {
|
||||
if (paragraphId2StmtIdMapping.containsKey(context.getParagraphId())) {
|
||||
paragraphId2StmtIdMapping.remove(context.getParagraphId());
|
||||
}
|
||||
paragraphId2StmtIdMapping.remove(paraId);
|
||||
}
|
||||
} else {
|
||||
LOGGER.warn("cancel is not supported for this version of livy: " + livyVersion);
|
||||
|
|
|
|||
Loading…
Reference in a new issue