Skip to content

Conversation

@zjffdu
Copy link
Contributor

@zjffdu zjffdu commented Jan 6, 2017

What is this PR for?

By default, livy session will expire after one hour. This PR would create session automatically for user if session is expired, and would also display the session expire information in frontend. The expire message would only display at the first time of session recreation, after that the message won't be displayed.

What type of PR is it?

[Improvement ]

Todos

  • - Task

What is the Jira issue?

How should this be tested?

Tested manually.
image

Screenshots (if appropriate)

Questions:

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

@zjffdu
Copy link
Contributor Author

zjffdu commented Jan 6, 2017

@prabhjyotsingh @felixcheung Please help review.

import org.apache.zeppelin.interpreter.InterpreterContext;
import org.apache.zeppelin.interpreter.InterpreterResult;
import org.apache.zeppelin.interpreter.InterpreterUtils;
import org.apache.zeppelin.interpreter.*;
Copy link
Member

Choose a reason for hiding this comment

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

what's our coding style guide on multiple imports? is it clearer to list them out

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is done by intellij which would use * when imports more than 5 classes in one package. I think it should be fine to do that.

stmtInfo = executeStatement(new ExecuteRequest(code));
} catch (SessionNotFoundException e) {
LOGGER.warn("Livy session {} is expired, new session will be created.", sessionInfo.id);
this.sessionExpired = true;
Copy link
Member

Choose a reason for hiding this comment

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

instead of saving this as a state, would be more self-contain to pass this as a flag to appendSessionExpire below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea !

result2.add(message.getType(), message.getData());
}
result2.add(InterpreterResult.Type.HTML,
"<hr/><font color=\"red\">Previous session is expired, new session is created.</font>");
Copy link
Member

Choose a reason for hiding this comment

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

perhaps it is better for this message to be at the top of the result output, rather than at the bottom of it? doesn't it require the user to scroll down if he has a long output?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm, make sense to put it at the top

@zjffdu
Copy link
Contributor Author

zjffdu commented Jan 9, 2017

@felixcheung I have addressed the comments and also fix one bug in LivySparkSQLInterpreter, and update the screenshot of testing in PR description.

@prabhjyotsingh
Copy link
Contributor

Tested locally, looks good.

resMsg.append("\n");
if (rows[3].indexOf("+") == 0) {

} else {
Copy link
Member

Choose a reason for hiding this comment

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

this exists before, but this construct is a bit strange?

if (rows[3].indexOf("+") == 0) {
 
 } else {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know about this logic, @prabhjyotsingh is the original author who might know this.

@felixcheung
Copy link
Member

LGTM.
what is the bug in LivySparkSQLInterpreter - should we have a JIRA for it?

@zjffdu
Copy link
Contributor Author

zjffdu commented Jan 10, 2017

The bug in LivySparkSQLInterpreter is caused by this PR and fixed in this PR. LivySparkSQLInterpreter delegate LivySparkInterpreter to generate InterpreterResult and then convert it to table type. So here since we make it as multiple InterpreterResult, we should only convert the InterpreterMessage with text type that is for sql output.

@zjffdu
Copy link
Contributor Author

zjffdu commented Jan 12, 2017

ping @felixcheung any more comments ?

@felixcheung
Copy link
Member

nope,
merging if no more comment

result2.add(InterpreterResult.Type.HTML,
"<font color=\"red\">Previous session is expired, new session is created.</font>");
"<font color=\"red\">Previous session is expired, new session is created. " +
"Paragraphes that depend on this paragraph need to be re-executed !" + "</font>");
Copy link
Member

Choose a reason for hiding this comment

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

I think it should be Paragraphs. Also, let remove the space before !

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, addressed.

@felixcheung
Copy link
Member

merging if no more comment

@asfgit asfgit closed this in 00742ff Jan 14, 2017
asfgit pushed a commit that referenced this pull request Jan 14, 2017
…new session

### What is this PR for?
By default, livy session will expire after one hour. This PR would create session automatically for user if session is expired, and would also display the session expire information in frontend. The expire message would only display at the first time of session recreation, after that the message won't be displayed.

### What type of PR is it?
[Improvement ]

### Todos
* [ ] - Task

### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-1293

### How should this be tested?
Tested manually.
![image](https://cloud.githubusercontent.com/assets/164491/21761175/2473c0c0-d68c-11e6-8f39-9e87333c6168.png)

### Screenshots (if appropriate)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Jeff Zhang <[email protected]>

Closes #1861 from zjffdu/ZEPPELIN-1293 and squashes the following commits:

e174593 [Jeff Zhang] minor update on warning message
30c3569 [Jeff Zhang] address comments
88f0d9a [Jeff Zhang] ZEPPELIN-1293. Livy Interpreter: Automatically attach or create to a new session
@zjffdu
Copy link
Contributor Author

zjffdu commented Jan 17, 2017

@felixcheung @minahlee Could any of you help to merge it into branch-0.7 as well ? Since this is only livy interpreter specific, so I don't think it would affect the 0.7 release.

@zjffdu
Copy link
Contributor Author

zjffdu commented Jan 17, 2017

@felixcheung @minahlee , Sorry my mistake, It has been merged into branch-0.7. @minahlee I notice you make the jira fixversion as 0.8, I add 0.7 as well.

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.

3 participants