Alberto,

Are you looking to write some java code that prints the contents of a file
in HDFS ? If so, take a look at IOUtils.copyBytes (IOUtils is in the package
hadoop.io.IOUtils) As an output stream, you could just use System.out

heres documentation on IOUtils:

http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/io/IOUtils.html


hope that helps

Goutham

You can print the content of a file

On Sun, Nov 1, 2009 at 8:55 AM, Alberto Luengo Cabanillas <[email protected]
> wrote:

> Hi everyone! In a project involving Hadoop (0.20.1) I´m working, I´d need
> to
> know if I´m reading properly the content of a file located in the HDFS.
> Beside the try...catch block, is there any other option for printing values
> in the console (in a similar way standard IO Java mechanisms do, like
> System.out.println("the variable is ", var))?
> Another thing, is there a simply way to debug Hadoop applications?
> (actually
> I´m working in pseudo-distributed mode, for developing purposes).
> Thanks a lot in advance.
>
> --
> Alberto
>

Reply via email to