mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
This PR applies the new interpreter registration mechanism to HDFSFileInterpreter
Improvement - Move interpreter registration properties from static block to interpreter-setting.json https://issues.apache.org/jira/browse/ZEPPELIN-910 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 * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No
This commit is contained in:
parent
18e75a3aa4
commit
b1ebf67b66
2 changed files with 27 additions and 11 deletions
|
|
@ -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;
|
||||
|
|
|
|||
27
file/src/main/resources/interpreter-setting.json
Normal file
27
file/src/main/resources/interpreter-setting.json
Normal file
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
Loading…
Reference in a new issue