-
Notifications
You must be signed in to change notification settings - Fork 2.8k
ZEPPELIN-963 ] Jobmanagement - (1) basic backend. #972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZEPPELIN-963 ] Jobmanagement - (1) basic backend. #972
Conversation
|
retry ci |
|
Thanks. Do you have any test scenario? It would help to add test cases. |
|
@jongyoul Thank you for your feedback. |
|
How about changing this title to add ZEPPELIN-963? |
|
@jongyoul I've changed. |
|
Update text for 'How should this be tested' and add json data comment. |
|
It's working nicely. |
|
http://127.0.0.1:8080/api/notebook/jobmanager/(get unixtime at before step) for example http://127.0.0.1:8080/api/notebook/jobmanager/ http://127.0.0.1:8080/api/notebook/jobmanager/1 |
|
Updated text for test scenario. @astroshim |
|
@cloverhearts Thank you for your explanation. You mean that the "LastResponseUnixTime" is for getting notebook information of lastest updated. |
|
Please review |
| List<Map<String, Object>> notebookJobs = notebook.getJobListforNotebook(false, 0); | ||
| Map<String, Object> response = new HashMap<>(); | ||
|
|
||
| response.put("lastResponseUnixTime", System.currentTimeMillis()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's actual time gap between System.currentTimeMillis and the result of notebook.getJobListforNotebook. Is it OK? Or I think you can use some information of notebookJobs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, exists a gap. But the gap is very small.
In addition, there is a solution for it.
'UnixTimeLastRun' value jobs in the Notebook will display the last update time.
It sends a 'unixTimeLastRun' value to the update request.
You can receive data without a gap of time since the update of the Notebook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cloverhearts If this is intended behaviour and isn't influenced on the right behaviour, I'm OK.
|
I think that the work is complete this feature. |
|
LGTM. Merging if there's no more discussion. |
|
Thank you! |
|
LGTM |
|
Merging it into master branch only. |
### What is this PR for? Job management basic backend. was divided into smaller " PR ". - apache#921 Receive the basic data of Job manager api and the backend have been implemented. ### What type of PR is it? Feature ### Todos - [x] - Basic backend for job manager. - [x] - Basic backend api ### What is the Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-963 ### How should this be tested? #### step 1. First, calling the rest api as follows receives the data of "job" of the whole. ```shell curl -H "Content-Type: application/json" -X GET http://127.0.0.1:8080/api/notebook/jobmanager/ ``` result ```json { "status":"OK", // result for api request "body":{ "lastResponseUnixTime":1465289938763, // last get server unixtime stamp. "jobs":[ // job list { "notebookId":"2BMQZ9QP6", // notebook id. "unixTimeLastRun":1465289017310, // notebook last running unixtime. "notebookType":"normal", // cron or normal "isRunningJob":false, // is Running? "notebookName":"Untitled Note 1226", // notebook name. "interpreter":"spark", // default interpreter group name or If you have not selected it does not exist. "paragraphs":[ { "name":"20160607-174331_232775609", // paragraph name 'undefined is notebook id' "id":"20160607-174331_232775609", // paragraph id "status":"FINISHED" // paragraph job status } ] } ] } } ``` #### step 2. For example, it showed the result of receiving the information as one of the notebook. focus on "lastResponseUnixTime" value. This value is inserted as an argument when you call the following restapi, us to be able to get the updated data. **Create a Notebook, or run the Paragraph.** And, **call updated notebook api** **"lastResponseUnixTime": 1465289938763** (step 1 get value) ```shell curl -H "Content-Type: application/json" -X GET http://127.0.0.1:8080/api/notebook/jobmanager/1465289938763 ``` #### step 3. If you created a Notebook, a new Notebook information is displayed. If there is a Notebook that if there is a Paragraph of the running, the information will also be displayed. #### step 4. When you restart the step1 of api, if you created a Notebook, the number of Notebook is +1 than when the first call. ### Questions: * Does the licenses files need update? no * Is there breaking changes for older versions? no * Does this needs documentation? yes Author: CloverHearts <cloverheartsdev@gmail.com> Closes apache#972 from cloverhearts/feat/sm/ZEPPELIN-531-basic-backend and squashes the following commits: 330ed73 [CloverHearts] change indent for jobmanager backend c7bf75a [CloverHearts] Jobmanager basic backend.
What is this PR for?
Job management basic backend.
was divided into smaller " PR ". - #921
Receive the basic data of Job manager api and the backend have been implemented.
What type of PR is it?
Feature
Todos
What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-963
How should this be tested?
step 1.
First, calling the rest api as follows receives the data of "job" of the whole.
curl -H "Content-Type: application/json" -X GET http://127.0.0.1:8080/api/notebook/jobmanager/result
{ "status":"OK", // result for api request "body":{ "lastResponseUnixTime":1465289938763, // last get server unixtime stamp. "jobs":[ // job list { "notebookId":"2BMQZ9QP6", // notebook id. "unixTimeLastRun":1465289017310, // notebook last running unixtime. "notebookType":"normal", // cron or normal "isRunningJob":false, // is Running? "notebookName":"Untitled Note 1226", // notebook name. "interpreter":"spark", // default interpreter group name or If you have not selected it does not exist. "paragraphs":[ { "name":"20160607-174331_232775609", // paragraph name 'undefined is notebook id' "id":"20160607-174331_232775609", // paragraph id "status":"FINISHED" // paragraph job status } ] } ] } }step 2.
For example, it showed the result of receiving the information as one of the notebook.
focus on "lastResponseUnixTime" value.
This value is inserted as an argument when you call the following restapi, us to be able to get the updated data.
Create a Notebook, or run the Paragraph.
And, call updated notebook api
"lastResponseUnixTime": 1465289938763 (step 1 get value)
curl -H "Content-Type: application/json" -X GET http://127.0.0.1:8080/api/notebook/jobmanager/1465289938763step 3.
If you created a Notebook, a new Notebook information is displayed.
If there is a Notebook that if there is a Paragraph of the running, the information will also be displayed.
step 4.
When you restart the step1 of api, if you created a Notebook, the number of Notebook is +1 than when the first call.
Questions: