GitHub user weand opened a pull request:
https://github.com/apache/zeppelin/pull/2706
ZEPPELIN-3105 Notebook not running via REST API after Zeppelin Restart
### What is this PR for?
Fixes regression introduced with
[ZEPPELIN-3013](https://issues.apache.org/jira/browse/ZEPPELIN-3013). Executing
Notebook and
Paragraph via Rest API was not possible anymore, because some parsing
was introduced paragraph.setText(...). The setter was not invoked after
deserialization, thus paragraph.intpText and paragraph.scriptText was
not set.
This PR fixes that by introducing a PostJsonDeserProcessable interface,
that can be used on any class implementing JsonSerializable, for
implementing some routines to be invoked after deserialization. For
enabling the interface, a corresponding TypeAdapterFactory must be
registered on the GsonBuilder.
Paragraph class now implements PostJsonDeserProcessable and parses
intpText and scriptText variables properly after deserialization.
Also a test was added, and AbstractTestRestApi.shutdown() method was
overloaded to support the use case of not deleting the interpreter.json
during server restart within one test case.
### What type of PR is it?
[Bug Fix]
### Todos
-
### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-3105
### How should this be tested?
Refer to the test case added,
org.apache.zeppelin.rest.NotebookRestApiTest.testRunWithServerRestart()
### Screenshots (if appropriate)
### Questions:
* Does the licenses files need update? - no
* Is there breaking changes for older versions? - no
* Does this needs documentation? - no
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/weand/zeppelin ZEPPELIN-3105
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/zeppelin/pull/2706.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2706
----
commit 0785ea5e85a43043c852b4f62270594f663ea977
Author: Andreas Weise <[email protected]>
Date: 2017-12-17T22:35:42Z
ZEPPELIN-3105 Notebook not running via REST API after Zeppelin Restart:
skip to run blank paragraph
### What is this PR for?
Fixes regression introduced with ZEPPELIN-3013. Executing Notebook and
Paragraph via Rest API was not possible anymore, because some parsing
was introduced paragraph.setText(...). The setter was not invoked after
deserialization, thus paragraph.intpText and paragraph.scriptText was
not set.
This PR fixes that by introducing a PostJsonDeserProcessable interface,
that can be used on any class implementing JsonSerializable. For
enabling the interface, a corresponding TypeAdapterFactory must be
registered on the GsonBuilder.
Paragraph class now implements PostJsonDeserProcessable and parses
intpText and scriptText variables properly.
Also a test was added, and AbstractTestRestApi.shutdown() method was
overloaded to support the use case of not deleting the interpreter.json
during server restart within one test case.
### What type of PR is it?
[Bug Fix]
### Todos
-
### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-3105
### How should this be tested?
Refer to the test case added,
org.apache.zeppelin.rest.NotebookRestApiTest.testRunWithServerRestart()
### Screenshots (if appropriate)
### Questions:
* Does the licenses files need update? - no
* Is there breaking changes for older versions? - no
* Does this needs documentation? - no
----
---