[ZEPPELIN-772] - Improve text append when streaming#804
[ZEPPELIN-772] - Improve text append when streaming#804corneadoug wants to merge 1 commit intoapache:masterfrom
Conversation
|
I tested....LGTM |
|
The expected behavior I would expect is the "Before" one. If I ask for a result, it should be consistent, whatever page I navigate in between. I would prefer a discussion on the mailing list to gather user feedback on this. |
|
Shouldn't all output be captured? Is there a reason we want to clear it when the user navigates out? Perhaps I'm not fully understanding the behavior change? |
|
Rebasing this on latest master should let current CI failure go. |
|
Maybe the GIFs are not obvious enough :) The PR is mainly trying to improve the rendering of the streaming capability introduced in #611. So I will try to explain more in detail what is happening and how things work on the front-end side. How It WorksFirst of all, its good to know that this is only a case for TEXT type of return values. The way the back-end communicates data to the front-end end is through 2 different websocket events:
So for example, if we take this code: It would send numbers from 1 to 40 with 1000ms interval, and this is what would happen: So the way it works is that the job results are never persisted inside the Notebook before the end of the job. The Current ProblemSince the temporary results are not persisted, whenever you navigate in and out of the Running Notebook, it will first reload the previous saved result in that paragraph. So if you did run a loop through the ABC before, The paragraph will render that result. Then you will receive some PARAGRAPH_APPEND_OUTPUT events from your running job, which will transform the result you see in your paragraph into something like: Mainly because the flush of previous result (visually) was done in the PARAGRAPH_UPDATE_OUTPUT event at the beginning of the job. What the PR achieveIn this PR, we try to clear the previous unrelated result of the paragraph when the paragraph receives an PARAGRAPH_APPEND_OUTPUT event for the first time in the Notebook, in order to keep result of that job only. |
|
@felixcheung @echarles does that explain a bit better? |
|
Ah that makes perfect sense, thanks for the detailed explanation. |
e871ba6 to
76a66a4
Compare
### What is this PR for? This PR is to improve the result output when having interpreter streaming running. If you navigate outside the notebook, then come back inside, the streaming output will append below previous result. ### What type of PR is it? Improvement ### What is the Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-772 ### How should this be tested? You can run this ``` (1 to 40).foreach{ i=> Thread.sleep(1000) println("Hello " + i) } ``` Then navigate to home, then back to the notebook. You should see the newly streamed result only. ### Screenshots Before:  After:  ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: Damien CORNEAU <[email protected]> Closes apache#804 from corneadoug/improve/flushStreamingOutput and squashes the following commits: 76a66a4 [Damien CORNEAU] Flush on first text append event
What is this PR for?
This PR is to improve the result output when having interpreter streaming running.
If you navigate outside the notebook, then come back inside, the streaming output will append below previous result.
What type of PR is it?
Improvement
What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-772
How should this be tested?
You can run this
Then navigate to home, then back to the notebook.
You should see the newly streamed result only.
Screenshots
Before:

After:

Questions: