hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Dunning" <ted.dunn...@gmail.com>
Subject Re: FileInputStream object in DFS
Date Tue, 16 Dec 2008 04:16:54 GMT
You can't use the normal java.io objects and method to access files in HDFS.

You can open an input stream from such a file, but you have to use the Path
and FileSystem objects to get it.

On Mon, Dec 15, 2008 at 6:47 PM, Bahir <santoshbahir@rediffmail.com> wrote:

>
> Hi guys,
>
> I am trying to use FileInputStream object for accessing file on DFS
> filesystem. But it is throwing exception "No Such file or directory".
> Though
> that file is present on DFS.
>
> The code line is -
>
> BufferedReader reader = new BufferedReader(new InputStreamReader(
>                                        new
> FileInputStream("/user/hadoop/input/inputfile")));
>
> where file /user/hadoop/input/inputfile is present in on dfs file system.
> This code is present in the mapper.
>
> Please advise me know if i am making any mistake.
>
> Thanks in advance.
>
> Cheers,
> Santosh
> --
> View this message in context:
> http://www.nabble.com/FileInputStream-object-in-DFS-tp21026325p21026325.html
> Sent from the Hadoop core-dev mailing list archive at Nabble.com.
>
>


-- 
Ted Dunning, CTO
DeepDyve
4600 Bohannon Drive, Suite 220
Menlo Park, CA 94025
www.deepdyve.com
650-324-0110, ext. 738
858-414-0013 (m)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message