zeppelin/java
Jongyoul Lee 55f6c91cab [ZEPPELIN-3740] Adopt google-java-format and fmt-maven-plugin
### What is this PR for?
Avoiding outdated checkstyle error.

To check format
`mvn validate`

To fix non-complying files
`mvn fmt:format`

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

### Todos
* [x] - Adopt `fmt-maven-plugin`

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

### How should this be tested?
CI passs

### Screenshots (if appropriate)

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

Author: Jongyoul Lee <jongyoul@gmail.com>

Closes #3158 from jongyoul/ZEPPELIN-3740 and squashes the following commits:

f06c50e90 [Jongyoul Lee] Adopt `fmt-maven-plugin` for google-java-format Adopt all files
2018-08-26 13:43:14 +09:00
..
src [ZEPPELIN-3740] Adopt google-java-format and fmt-maven-plugin 2018-08-26 13:43:14 +09:00
pom.xml [ZEPPELIN-3740] Adopt google-java-format and fmt-maven-plugin 2018-08-26 13:43:14 +09:00
README.md [ZEPPELIN-3653] - New Java interpreter 2018-08-03 09:15:19 +08:00

Overview

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.

Technical overview

  • Upon starting an interpreter, an instance of JavaCompiler is created.

  • 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.

  • 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.