Uh oh!
There was an error while loading. Please reload this page.
[ZEPPELIN-699] Add new synchronous paragraph run REST API - #746
[ZEPPELIN-699] Add new synchronous paragraph run REST API#746doanduyhai wants to merge 2 commits into
Conversation
28f2084 to
e14f08aCompare| if (result.code() == InterpreterResult.Code.SUCCESS) { | ||
| return new JsonResponse<>(Status.OK, result.message()).build(); | ||
| } else { | ||
| return new JsonResponse<>(Status.OK).build(); |
There was a problem hiding this comment.
shouldn't it not return OK if its run fails?
vgkowski
commented
Feb 25, 2016
I would prefer to not return OK in case of failure |
e14f08a to
bdd0788Comparedoanduyhai
commented
Feb 25, 2016
Fixed |
| paragraph.setListener(note.getJobListenerFactory().getParagraphJobListener(note)); | ||
| } | ||
| paragraph.run(); |
There was a problem hiding this comment.
paragraph supposed to not run in this way.
It should always run through Scheduler that Interpreter provides.
Leemoonsoo
commented
Feb 25, 2016
This PR change behavior of REST api To me it's better we keep asynchronous behavior for backward compatibility. Some user might depends on asynchronous behavior. Synchronous behavior can be implemented in a different rest api. |
doanduyhai
commented
Feb 25, 2016
@Leemoonsoo so you're suggesting to create another API for pagraph execution ? Fine for me, what's about |
Leemoonsoo
commented
Feb 25, 2016
@doanduyhai Right. for asynchronous behavior, multiple API is required to control the job, like submitting job (POST), canceling job (DELETE), get status of job (GET) to but for synchronous behavior, a single API will go through all the lifecycle of the job, from submitting to get result. So how about just say
|
vgkowski
commented
Feb 25, 2016
I would suggest to use the same method as for the spark job server, asynchronous is the default, synchronous is obtain with an additional parameter. De : Lee moon soo [mailto:notifications@github.com] This PR change behavior of REST api job/{notebookId}/{paragraphId} from asynchronous to synchronous. To me it's better we keep asynchronous behavior for backward compatibility. Some user might depends on asynchronous behavior. Synchronous behavior can be implemented in a different rest api. — Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc This message and its attachments may contain confidential or privileged information that may be protected by law; |
doanduyhai
commented
Feb 25, 2016
@vgromakowski Something like |
Leemoonsoo
commented
Feb 25, 2016
I don't have strong opinion here for adding parameter vs new api. When sync is false, return success or fail for the job submission. That makes the api difficult to understand. And later, there could be some additional parameter introduced for only for async api or only for sync api. in that case, combination of different parameters need to be explained for users. So i'm little bit biased to new api for this reasons. what do you guys think? |
doanduyhai
commented
Feb 25, 2016
Humm, your remark about future extension of the existing API with new parameter makes sense. We need to design API carefully to make evolution easier. This plays in favor for a separate API By the way, for the existing asynchronous API, I don't think returning OK in all cases is correct. Since the execution of the paragraph is asynchronous and we don't wait for it to return the result to the client, how can we know if the execution has been successful or not ? How can we decide if we should return OK or INTERNAL_SERVER_ERROR ? |
felixcheung
commented
Feb 25, 2016
that we would need a job run status API... |
felixcheung
commented
Mar 13, 2016
hello - where are we on this? |
doanduyhai
commented
Mar 13, 2016
@felixcheung I'm still waiting for someone to reply me on my question:
Or do you think we can just let it as it is and create the new API ? |
fireboy1919
commented
Mar 14, 2016
I have a similar REST endpoint based upon the use of resource pools (i.e., starting from this pull request): I made mine use this form: This is a bit more flexible than pulling straight from the paragraph and does not have synchronous API problem. Once that new pull request has been approved, I'll format and post my pull request. |
felixcheung
commented
Mar 14, 2016
@doanduyhai typically async pattern in REST, it seems, is either:
|
felixcheung
commented
May 13, 2016
hello - how are we on this? |
doanduyhai
commented
Jun 2, 2016
@felixcheung I've updated the PR to create a new API as suggested by @Leemoonsoo : All my apologies for the long delay, I was lately busy with Cassandra |
| <td>URL</td> | ||
| <td>```http://[zeppelin-server]:[zeppelin-port]/api/notebook/run/[notebookId]/[paragraphId]```</td> | ||
| </tr> | ||
| <tr> |
There was a problem hiding this comment.
could you please fix the extra space for this and next line?
There was a problem hiding this comment.
thanks, I'm referring to whitespaces in/around <td> Fail code</td>, <td> 500 </td> or <td> sample JSON input (optional, only needed when if you want to update dynamic form's value) </td> - are they intentional?
doanduyhai
commented
Jun 3, 2016
@felixcheung Done, I've added 2 new screen captures of the API documentation update |
doanduyhai
commented
Jun 3, 2016
Hello @bzz, I've rebased from the latest master and my PR always fail with this issue: You have committed recently a fix for I have the exact same error on my other PR for Cassandra interpreter update: #950 |
doanduyhai
commented
Jun 15, 2016
Rebased from master |
doanduyhai
commented
Aug 29, 2016
Ok, there are 3 unrelated errors: The test timeoud because the default implicit for Scala Some flaky remote interpreter test. When running locally the test with Just a classical NPM download failure: @felixcheung@jongyoul Can we merge this and move on ? This PR has been there for a while and I have re-based it many times against master |
doanduyhai
commented
Aug 30, 2016
Ping @Leemoonsoo , can we merge this long-standing PR ? CI failures are irrelevant as mentioned above |
jongyoul
commented
Aug 31, 2016
I've glanced at this PR. I think this PR never break current behaviour and codes looks good. If it doesn't have more issues, it's enough to merge this PR. |
felixcheung
commented
Sep 1, 2016
Done! |
doanduyhai
commented
Sep 1, 2016
Thank you @felixcheung. Finally merged ! |
What is this PR for?
Right now, when calling the REST API
http://<ip>:<port>/api/notebook/job/<note_id>/<paragraph_id>Zeppelin always returns OK as shown by this source code: https://github.com/apache/incubator-zeppelin/blob/master/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java#L477This ticket will update the behavior so that Zeppelin also return the result of the paragraph execution
What type of PR is it?
[Improvement]
Todos
Is there a relevant Jira issue?
ZEPPELIN-699
How should this be tested?
git fetch origin pull/746/head:ParagraphExecutionRESTAPIgit checkout ParagraphExecutionRESTAPImvn clean package -DskipTestsbin/zeppelin-daemon.sh restarthttp://<ip>:<port>/api/notebook/run/<note_id>/<paragraph_id>Screenshots (if appropriate)
API Documentation update
Existing asynchronous API

New synchronous API

Questions: