Updated documentation for Java interpreter to be more explicit on the limitations.

This commit is contained in:
Vincenzo Selvaggio 2018-08-01 10:19:03 +01:00
parent ce9401079f
commit b686340348
2 changed files with 4 additions and 4 deletions

View file

@ -25,7 +25,7 @@ limitations under the License.
<div id="toc"></div>
## How to use
Basically, you can write normal java code. You should write the main method inside a class because the interpreter invoke this main to execute the code. Unlike Zeppelin normal pattern, each paragraph is considered as a separate job, there isn't any relation to any other paragraph.
Basically, you can write normal java code. You should write the main method inside a class because the interpreter invoke this main to execute the code. Unlike Zeppelin normal pattern, each paragraph is considered as a separate job, there isn't any relation to any other paragraph. For example, a variable defined in one paragraph cannot be used in another one as each paragraph is a self contained java main class that is executed and the output returned to Zeppelin.
The following is a demonstration of a word count example with data represented as a java Map and displayed leveraging Zeppelin's built in visualization using the utility method `JavaInterpreterUtils.displayTableFromSimpleMap`.

View file

@ -2,7 +2,7 @@
Java interpreter for Apache Zeppelin
# Architecture
Current interpreter implementation supports the static REPL. It compiles the code in memory, execute it and redirect the output to zeppelin.
Current interpreter implementation supports the static REPL. It compiles the code in memory, execute it and redirect the output to Zeppelin.
### Technical overview
@ -10,8 +10,8 @@ Current interpreter implementation supports the static REPL. It compiles the cod
* When the user runs commands with java, the `JavaParser` go through the code to get a class that contains the main method.
* Then it replaces the class name with random class name to avoid overriding while compilation. It creates new out & err stream to get the data in new stream instead of the console, to redirect output to zeppelin.
* Then it replaces the class name with random class name to avoid overriding while compilation. It creates new out & err stream to get the data in new stream instead of the console, to redirect output to Zeppelin.
* If there is any error during compilation, it can catch and redirect to zeppelin.
* If there is any error during compilation, it can catch and redirect to Zeppelin.
* `JavaInterpreterUtils` contains useful methods to print out Java collections and leverage Zeppelin's built in visualization.