This will work with some corrections - I assume that the code you inserted is simply truncated:
Path pt=new Path("hdfs://pathTofile"); FileSystem fs = FileSystem.get(context.getConfiguration()); BufferedReader br=new BufferedReader(new InputStreamReader(fs.open(pt))); try { String line; line=br.readLine(); while (line != null){ System.out.println(line);
You can have several cartographers reading the same file, but there is a limitation where it makes sense to use a distributed cache (not only reducing the load on the data nodes that place blocks for the file, but also be more efficient if you have work with more tasks than you have task nodes)
Chris white
source share