Repository: incubator-zeppelin Updated Branches: refs/heads/master 47a7decd5 -> 6744c0d1d
ZEPPELIN-544 ] After the restart when setting bug fixes interpreters note paragraphs state. ### What is this PR for? Restful api - call upon the setting / interpreter id type, The problem occurs in the status of running Paragraphs. - Paragraphs status code changes and restart missing ### What type of PR is it? Bug Fix ### Todos ### Is there a relevant Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-544 ### How should this be tested? Paragraphs running after interpreter config change, save -> click okay on restart dialog ### Screenshots (if appropriate) #### before  #### after  ### Questions: * Does the licenses files need update? no * Is there breaking changes for older versions? no * Does this needs documentation? no Author: CloverHearts <[email protected]> Closes #581 from cloverhearts/bug_fix/interpreter_restart_abort and squashes the following commits: f9294e2 [CloverHearts] stop job code -> new private method(stopJobAllInterpreter) f6fe216 [CloverHearts] restful api setting-interpreterid bug fix. Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/6744c0d1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/6744c0d1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/6744c0d1 Branch: refs/heads/master Commit: 6744c0d1d5d7c575d648fabbbbb9ad63c1aee76e Parents: 47a7dec Author: CloverHearts <[email protected]> Authored: Tue Dec 29 21:15:53 2015 -0800 Committer: Lee moon soo <[email protected]> Committed: Sun Jan 3 07:58:44 2016 -0800 ---------------------------------------------------------------------- .../interpreter/InterpreterFactory.java | 34 ++++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/6744c0d1/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java ---------------------------------------------------------------------- diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java index 1beebde..9591a7f 100644 --- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java +++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java @@ -519,6 +519,9 @@ public class InterpreterFactory { synchronized (interpreterSettings) { InterpreterSetting intpsetting = interpreterSettings.get(id); if (intpsetting != null) { + + stopJobAllInterpreter(intpsetting); + intpsetting.getInterpreterGroup().close(); intpsetting.getInterpreterGroup().destroy(); @@ -541,20 +544,7 @@ public class InterpreterFactory { InterpreterSetting intpsetting = interpreterSettings.get(id); if (intpsetting != null) { - for (Interpreter intp : intpsetting.getInterpreterGroup()) { - for (Job job : intp.getScheduler().getJobsRunning()) { - job.abort(); - job.setStatus(Status.ABORT); - logger.info("Job " + job.getJobName() + " aborted "); - } - - for (Job job : intp.getScheduler().getJobsWaiting()) { - job.abort(); - job.setStatus(Status.ABORT); - logger.info("Job " + job.getJobName() + " aborted "); - } - } - + stopJobAllInterpreter(intpsetting); intpsetting.getInterpreterGroup().close(); intpsetting.getInterpreterGroup().destroy(); @@ -570,6 +560,22 @@ public class InterpreterFactory { } } + private void stopJobAllInterpreter(InterpreterSetting intpsetting) { + if (intpsetting != null) { + for (Interpreter intp : intpsetting.getInterpreterGroup()) { + for (Job job : intp.getScheduler().getJobsRunning()) { + job.abort(); + job.setStatus(Status.ABORT); + logger.info("Job " + job.getJobName() + " aborted "); + } + for (Job job : intp.getScheduler().getJobsWaiting()) { + job.abort(); + job.setStatus(Status.ABORT); + logger.info("Job " + job.getJobName() + " aborted "); + } + } + } + } public void close() { List<Thread> closeThreads = new LinkedList<Thread>();
