Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set hadoop configuration?

Hello!
I would like to integrate this code in a tJavaMR. (It reads a file from hdfs)
However i don't know how to integrate some Hadoop parameters as for example:
"Configuration conf = context.getConfiguration();"
or
"FileSystem fs = FileSystem.get(conf);"

Do you know where i can set these parameters please?

Best regards

Here is the code:
Configuration conf = context.getConfiguration();
String file = conf.get("my.own.file", "hdfs://file.xml");
Path path = new Path(file);
FileSystem fs = FileSystem.get(conf);

BufferedReader bread = new BufferedReader(new InputStreamReader(fs.open(path)));
StringBuilder sb = new StringBuilder();
String line = bread.readLine();

while (line != null) {
sb.append(line).append("\n");
line = bread.readLine();
}
String xml = sb.toString();
Labels (4)
1 Reply
Anonymous
Not applicable
Author

Hi djidji,
Of course ,you can do it.
Please to my attachment.

jjzhou
0683p000009MCqq.png