Repository: zeppelin
Updated Branches:
refs/heads/master efdc16d71 -> afd324e02
ZEPPELIN-3211. REST API: Enable running all paragraphs without waiting for
finish
### What is this PR for?
At the moment there is no possibility on Notebook REST API to run all
paragraphs in a notebook and return without waiting for finish. Would be useful
to have an optional extra param `waitToFinish` on `api/notebook/job/{noteId}`
which is true by default.
### What type of PR is it?
[Improvement]
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-3211
### How should this be tested?
* can be tested manually, invoking REST API: curl -s -X POST
"http://{{zeppelin_server}}/api/notebook/job/{noteId}?waitToFinish=false"
### Questions:
* Does the licenses files need update?
* Is there breaking changes for older versions?
* Does this needs documentation?
Author: Magyari Sandor Szilard <[email protected]>
Closes #2772 from sancyx/master-ZEPPELIN-3211 and squashes the following
commits:
e6005225a [Magyari Sandor Szilard] ZEPPELIN-3211. REST API: Enable running all
paragraphs without waiting for finish (magyari_sandor)
Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/afd324e0
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/afd324e0
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/afd324e0
Branch: refs/heads/master
Commit: afd324e02f795a42d8943ee21589c99b661a50d0
Parents: efdc16d
Author: Magyari Sandor Szilard <[email protected]>
Authored: Wed Jan 31 18:10:50 2018 +0100
Committer: Jongyoul Lee <[email protected]>
Committed: Mon Jul 9 08:03:46 2018 +0900
----------------------------------------------------------------------
.../main/java/org/apache/zeppelin/rest/NotebookRestApi.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/afd324e0/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java
----------------------------------------------------------------------
diff --git
a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java
b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java
index a679502..1a5894c 100644
---
a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java
+++
b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java
@@ -661,16 +661,18 @@ public class NotebookRestApi {
@POST
@Path("job/{noteId}")
@ZeppelinApi
- public Response runNoteJobs(@PathParam("noteId") String noteId)
+ public Response runNoteJobs(@PathParam("noteId") String noteId,
+ @QueryParam("waitToFinish") Boolean waitToFinish)
throws IOException, IllegalArgumentException {
- LOG.info("run note jobs {} ", noteId);
+ boolean blocking = waitToFinish == null ? true :
waitToFinish.booleanValue();
+ LOG.info("run note jobs {} waitToFinish: {}", noteId, blocking);
Note note = notebook.getNote(noteId);
AuthenticationInfo subject = new
AuthenticationInfo(SecurityUtils.getPrincipal());
checkIfNoteIsNotNull(note);
checkIfUserCanRun(noteId, "Insufficient privileges you cannot run job for
this note");
try {
- note.runAll(subject, true);
+ note.runAll(subject, blocking);
} catch (Exception ex) {
LOG.error("Exception from run", ex);
return new JsonResponse<>(Status.PRECONDITION_FAILED,