Repository: incubator-zeppelin
Updated Branches:
  refs/heads/master e6a44d8cc -> 164bcd36a


[ZEPPELIN-911] Apply new mechanism to FlinkInterpreter

### What is this PR for?
This PR applies the new interpreter registration mechanism to FlinkInterpreter.

### What type of PR is it?
Improvement

### Todos
 - Move interpreter registration properties from static block to 
interpreter-setting.json

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

### How should this be tested?
1. apply patch
2. rm -r interpreter/flink
3. rm conf/interpreter.json
4. mvn clean package -DskipTests -pl flink
5. bin/zeppelin-daemon.sh start
6. run some paragraph with simple Flink queries

Questions:

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

Author: rerngvit <[email protected]>

Closes #977 from rerngvit/ZEPPELIN-911 and squashes the following commits:

99b91e4 [rerngvit] [ZEPPELIN-911] Apply new mechanism to FlinkInterpreter


Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/164bcd36
Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/164bcd36
Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/164bcd36

Branch: refs/heads/master
Commit: 164bcd36a1e73f074d820014dc0341414fc09967
Parents: e6a44d8
Author: rerngvit <[email protected]>
Authored: Wed Jun 8 22:35:09 2016 +0200
Committer: Jongyoul Lee <[email protected]>
Committed: Thu Jun 9 22:22:33 2016 +0900

----------------------------------------------------------------------
 flink/pom.xml                                   |  1 +
 .../apache/zeppelin/flink/FlinkInterpreter.java | 13 ------------
 .../src/main/resources/interpreter-setting.json | 21 ++++++++++++++++++++
 3 files changed, 22 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/164bcd36/flink/pom.xml
----------------------------------------------------------------------
diff --git a/flink/pom.xml b/flink/pom.xml
index d477529..16187a1 100644
--- a/flink/pom.xml
+++ b/flink/pom.xml
@@ -159,6 +159,7 @@
             <exclude>**/.project</exclude>
             <exclude>**/target/**</exclude>
             <exclude>**/README.md</exclude>
+            <exclude>**/interpreter-setting.json</exclude>
             <exclude>dependency-reduced-pom.xml</exclude>
           </excludes>
         </configuration>

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/164bcd36/flink/src/main/java/org/apache/zeppelin/flink/FlinkInterpreter.java
----------------------------------------------------------------------
diff --git 
a/flink/src/main/java/org/apache/zeppelin/flink/FlinkInterpreter.java 
b/flink/src/main/java/org/apache/zeppelin/flink/FlinkInterpreter.java
index 5042b96..743f884 100644
--- a/flink/src/main/java/org/apache/zeppelin/flink/FlinkInterpreter.java
+++ b/flink/src/main/java/org/apache/zeppelin/flink/FlinkInterpreter.java
@@ -67,19 +67,6 @@ public class FlinkInterpreter extends Interpreter {
     super(property);
   }
 
-  static {
-    Interpreter.register(
-        "flink",
-        "flink",
-        FlinkInterpreter.class.getName(),
-        new InterpreterPropertyBuilder()
-                .add("host", "local",
-                    "host name of running JobManager. 'local' runs flink in 
local mode")
-          .add("port", "6123", "port of running JobManager")
-          .build()
-    );
-  }
-
   @Override
   public void open() {
     out = new ByteArrayOutputStream();

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/164bcd36/flink/src/main/resources/interpreter-setting.json
----------------------------------------------------------------------
diff --git a/flink/src/main/resources/interpreter-setting.json 
b/flink/src/main/resources/interpreter-setting.json
new file mode 100644
index 0000000..067e7b8
--- /dev/null
+++ b/flink/src/main/resources/interpreter-setting.json
@@ -0,0 +1,21 @@
+[
+  {
+    "group": "flink",
+    "name": "flink",
+    "className": "org.apache.zeppelin.flink.FlinkInterpreter",
+    "properties": {
+      "host": {
+        "envName": "host",
+        "propertyName": null,
+        "defaultValue": "local",
+        "description": "host name of running JobManager. 'local' runs flink in 
local mode."
+      },
+      "port": {
+        "envName": "port",
+        "propertyName": null,
+        "defaultValue": "6123",
+        "description": "port of running JobManager."
+      }
+    }
+  }
+]

Reply via email to