From 99b91e4b5618230c39cecb24affdf5ecfcc0f512 Mon Sep 17 00:00:00 2001 From: rerngvit Date: Wed, 8 Jun 2016 22:35:09 +0200 Subject: [PATCH] [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 --- flink/pom.xml | 1 + .../zeppelin/flink/FlinkInterpreter.java | 13 ------------ .../main/resources/interpreter-setting.json | 21 +++++++++++++++++++ 3 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 flink/src/main/resources/interpreter-setting.json diff --git a/flink/pom.xml b/flink/pom.xml index d477529bbfc..16187a1795d 100644 --- a/flink/pom.xml +++ b/flink/pom.xml @@ -159,6 +159,7 @@ **/.project **/target/** **/README.md + **/interpreter-setting.json dependency-reduced-pom.xml 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 5042b96ea08..743f8846441 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 FlinkInterpreter(Properties property) { 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(); diff --git a/flink/src/main/resources/interpreter-setting.json b/flink/src/main/resources/interpreter-setting.json new file mode 100644 index 00000000000..067e7b84e44 --- /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." + } + } + } +]