hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabrice Medio <fme...@discoverymining.com>
Subject Re: Dose hadoop just provide reading by line
Date Wed, 12 Dec 2007 00:26:26 GMT
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
> 


Mime
View raw message