Repository: zeppelin Updated Branches: refs/heads/master 88476c38a -> a691e94c5
[ZEPPELIN-910] New interpreter registration mechanism to HDFSFileInterpreter ### What is this PR for? This PR applies the new interpreter registration mechanism to HDFSFileInterpreter ### What type of PR is it? Improvement ### Todos Move interpreter registration properties from a static block to interpreter-setting.json ### What is the Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-910 ### How should this be tested? 1. apply patch 2. rm conf/interpreter.json 3. mvn clean package -DskipTests 4. bin/zeppelin-daemon.sh start 5. Configure %file interpreter setting according to your HDFS setup 6. run some paragraph with HDFS file access ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: Rerngvit Yanggratoke <[email protected]> Closes #1211 from rerngvit/ZEPPELIN-804 and squashes the following commits: b1ebf67 [Rerngvit Yanggratoke] This PR applies the new interpreter registration mechanism to HDFSFileInterpreter Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/a691e94c Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/a691e94c Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/a691e94c Branch: refs/heads/master Commit: a691e94c5cb1539145d8dfe6f005501d044a87a9 Parents: 88476c3 Author: Rerngvit Yanggratoke <[email protected]> Authored: Wed Jul 20 23:29:06 2016 +0200 Committer: Alexander Bezzubov <[email protected]> Committed: Fri Jul 22 14:01:50 2016 +0900 ---------------------------------------------------------------------- .../zeppelin/file/HDFSFileInterpreter.java | 11 -------- .../src/main/resources/interpreter-setting.json | 27 ++++++++++++++++++++ 2 files changed, 27 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/a691e94c/file/src/main/java/org/apache/zeppelin/file/HDFSFileInterpreter.java ---------------------------------------------------------------------- diff --git a/file/src/main/java/org/apache/zeppelin/file/HDFSFileInterpreter.java b/file/src/main/java/org/apache/zeppelin/file/HDFSFileInterpreter.java index 43dd048..c2caa11 100644 --- a/file/src/main/java/org/apache/zeppelin/file/HDFSFileInterpreter.java +++ b/file/src/main/java/org/apache/zeppelin/file/HDFSFileInterpreter.java @@ -37,17 +37,6 @@ public class HDFSFileInterpreter extends FileInterpreter { static final String HDFS_USER = "hdfs.user"; static final String HDFS_MAXLENGTH = "hdfs.maxlength"; - static { - Interpreter.register( - "hdfs", - "file", - HDFSFileInterpreter.class.getName(), - new InterpreterPropertyBuilder() - .add(HDFS_URL, "http://localhost:50070/webhdfs/v1/", "The URL for WebHDFS") - .add(HDFS_USER, "hdfs", "The WebHDFS user") - .add(HDFS_MAXLENGTH, "1000", "Maximum number of lines of results fetched").build()); - } - Exception exceptionOnConnect = null; HDFSCommand cmd = null; Gson gson = null; http://git-wip-us.apache.org/repos/asf/zeppelin/blob/a691e94c/file/src/main/resources/interpreter-setting.json ---------------------------------------------------------------------- diff --git a/file/src/main/resources/interpreter-setting.json b/file/src/main/resources/interpreter-setting.json new file mode 100644 index 0000000..85ff746 --- /dev/null +++ b/file/src/main/resources/interpreter-setting.json @@ -0,0 +1,27 @@ +[ + { + "group": "file", + "name": "hdfs", + "className": "org.apache.zeppelin.file.HDFSFileInterpreter", + "properties": { + "hdfs.url": { + "envName": null, + "propertyName": "hdfs.url", + "defaultValue": "http://localhost:50070/webhdfs/v1/", + "description": "The URL for WebHDFS" + }, + "hdfs.user": { + "envName": null, + "propertyName": "hdfs.user", + "defaultValue": "hdfs", + "description": "The WebHDFS user" + }, + "hdfs.maxlength": { + "envName": null, + "propertyName": "hdfs.maxlength", + "defaultValue": "1000", + "description": "Maximum number of lines of results fetched" + } + } + } +]
