Skip to content

ZEPPELIN-963 ] Jobmanagement - (1) basic backend. - #972

Closed
cloverhearts wants to merge 2 commits into
apache:masterfrom
cloverhearts:feat/sm/ZEPPELIN-531-basic-backend
Closed

ZEPPELIN-963 ] Jobmanagement - (1) basic backend.#972
cloverhearts wants to merge 2 commits into
apache:masterfrom
cloverhearts:feat/sm/ZEPPELIN-531-basic-backend

Conversation

@cloverhearts

@cloverheartscloverhearts commented Jun 7, 2016

Copy link
Copy Markdown
Member

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

  • - Basic backend for job manager.
  • - 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.

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/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

@cloverhearts

Copy link
Copy Markdown
MemberAuthor

retry ci

@jongyoul

Copy link
Copy Markdown
Member

Thanks. Do you have any test scenario? It would help to add test cases.

@cloverhearts

Copy link
Copy Markdown
MemberAuthor

@jongyoul Thank you for your feedback.
I'll write about test scenario.

@jongyoul

Copy link
Copy Markdown
Member

How about changing this title to add ZEPPELIN-963?

@cloverheartscloverhearts changed the title ZEPPELIN-531 ] Jobmanagement - (1) basic backend.ZEPPELIN-963 ] Jobmanagement - (1) basic backend.Jun 7, 2016
@cloverhearts

Copy link
Copy Markdown
MemberAuthor

@jongyoul I've changed.

@cloverhearts

Copy link
Copy Markdown
MemberAuthor

Update text for 'How should this be tested' and add json data comment.

@astroshim

Copy link
Copy Markdown
Contributor

It's working nicely.
but Is the correct behavior that the lastResponseUnixTime is increased whenever call the curl?
Then i can't understand what's the purpose of step 3. Could you tell me more detail?

@cloverhearts

Copy link
Copy Markdown
MemberAuthor

@cloverhearts

cloverhearts commented Jun 9, 2016

Copy link
Copy Markdown
MemberAuthor

Updated text for test scenario.

@astroshim
Yes, lastResponseUnixTime value is update data area key.
to query the Future updates based on LastResponseUnixTime value by updating continue this value,
it is possible to get the data updated based on the lastResponseUnixTime.

@astroshim

Copy link
Copy Markdown
Contributor

@cloverhearts Thank you for your explanation. You mean that the "LastResponseUnixTime" is for getting notebook information of lastest updated.

@cloverhearts

Copy link
Copy Markdown
MemberAuthor

Please review

List<Map<String, Object>> notebookJobs = notebook.getJobListforNotebook(false, 0);
Map<String, Object> response = new HashMap<>();

response.put("lastResponseUnixTime", System.currentTimeMillis());

Copy link
Copy Markdown
Member

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.

@cloverheartscloverheartsJun 10, 2016

Copy link
Copy Markdown
MemberAuthor

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.

Copy link
Copy Markdown
Member

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.

@cloverhearts

Copy link
Copy Markdown
MemberAuthor

I think that the work is complete this feature.
Do you have any other comments?

@jongyoul

Copy link
Copy Markdown
Member

LGTM. Merging if there's no more discussion.

@cloverhearts

Copy link
Copy Markdown
MemberAuthor

Thank you!

@astroshim

Copy link
Copy Markdown
Contributor

LGTM

@jongyoul

Copy link
Copy Markdown
Member

Merging it into master branch only.

AhyoungRyu pushed a commit to AhyoungRyu/zeppelin that referenced this pull request Jun 15, 2016
### 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>
Closesapache#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.
@cloverhearts
cloverhearts deleted the feat/sm/ZEPPELIN-531-basic-backend branch June 16, 2016 06:25
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@cloverhearts@jongyoul@astroshim