Skip to content

Conversation

@cloverhearts
Copy link
Member

@cloverhearts cloverhearts commented Jan 21, 2017

What is this PR for?

You can get the state of a paragraph through ZeppelinContext.
This allows you to implement code according to the paragraph condition.

related
#1799

What type of PR is it?

Feature

What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-1886

How should this be tested?

  1. run paragraph.
  2. Record the noteid and paragraph id of the paragraph you have run.
  3. You can use the following code:
    for example
%spark
z.getJobStatus("noteID", "paragraphId").name()
z.getJobStatus("2C8D89Y9N", "20170121-042805_156018837").isFinished()
z.getJobStatus("2C8D89Y9N", "20170121-042805_156018837").isAbort()
z.getJobStatus("2C8D89Y9N", "20170121-042805_156018837").isError()
z.getJobStatus("2C8D89Y9N", "20170121-042805_156018837").isPending()
z.getJobStatus("2C8D89Y9N", "20170121-042805_156018837").isRunning()

Screenshots (if appropriate)

zeppelinstatus

Questions:

  • Does the licenses files need update? no
  • Is there breaking changes for older versions? no
  • Does this needs documentation? yes

Copy link
Member

@Leemoonsoo Leemoonsoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for @cloverhearts useful new feature.

It looks great. However, while it's new feature, do you mind add a test for it?
I think you can make test similar to ZeppelinSparkClusterTest.zRunTest().

return getJobStatus().isRunning();
}

public String getStatus() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. how about change method name to name()?

Then api will be look like,

before

z. getZeppelinJobStatus().getStatus()

after

z. getZeppelinJobStatus().name()

which avoid repeating Status and more clear while it's returning name of status instead of returning Status type.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Leemoonsoo
:)
Thank you for your good idea.
Yes, I will.

* @return
*/
@ZeppelinApi
public RemoteZeppelinJobStatus getZeppelinJobStatus(String noteId, String paragraphId) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about remove 'Zeppelin' from method name? so using this api will looks like

before

z.getZeppelinJobStatus()

after

z.getJobStatus()

So we API becomes more consistent along with other existing APIs, they don't include 'Zeppelin' in method name, i.e.

z.run()
z.runNote()
z.show()
z.getJobStatus()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Leemoonsoo Okay, I will fix it

@Leemoonsoo
Copy link
Member

Could you rebase/merge master and see if CI passes?

This branch has a lot of CI build failure which is fixed by #1939

@cloverhearts cloverhearts reopened this Feb 2, 2017
@asfgit asfgit closed this in a962ea1 Jul 4, 2018
Sign up for free to 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.

2 participants