FAQ
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.

Search Discussions

  • Ted Dunning at Dec 16, 2008 at 4:17 am
    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 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)

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommon-dev @
categorieshadoop
postedDec 16, '08 at 2:48a
activeDec 16, '08 at 4:17a
posts2
users2
websitehadoop.apache.org...
irc#hadoop

2 users in discussion

Bahir: 1 post Ted Dunning: 1 post

People

Translate

site design / logo © 2022 Grokbase