Are you talking about reading arbitrary files from HDFS?
You can just get a regular InputStream to a Path:

JobConf conf = new JobConf(SomeJob.class);
FileSystem hdfs = FileSystem.get(conf);
FSDataInputStream inputStream = hdfs.open(new Path("/my/path"));
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
String s = reader.readLine();

Fabrice

Bin YANG wrote:
hi colleague,

Does hadoop just provide reading the files from line to line?
How can I read many lines from a file?

thanks


Reply via email to