FileNotFoundException when using Hadoop distributed cache

前端 未结 1 1500
孤街浪徒
孤街浪徒 2021-01-29 09:41

this time someone should please relpy i am struggling with running my code using distributed cahe. i have already the files on hdfs but when i run this code :

i         


        
1条回答
  •  花落未央
    2021-01-29 10:37

    The problem is with the filename you are using "~/ayush/output/part-00000" relies on Unix shell (sh, bash, ksh) tilde expansion to replace the "~" with the pathname of your home directory.

    Java (and C, and C++, and most other programming languages) don't do tilde expansion. You need to provide the pathname as "/home/ayush/output/part-00000" ... or whatever absolute pathname it is that the tilded form expands to.

    Strictly speaking, the URI should be created as follows:

    new File("/home/ayush/output/part-00000").toURI()
    

    not as

    new URI("/home/ayush/output/part-00000")
    

    The latter creates a URI without a "protocol", and that could be problematic.

    0 讨论(0)
提交回复
热议问题