我在尝试读取添加到分布式缓存的文件时在 Hadoop 中遇到此异常,奇怪的是该文件存在于给定位置
java.io.FileNotFoundException: File does not exist: /tmp/hadoop-pera/mapred/local/taskTracker/distcache/-1517670662102870873_-1918892372_1898431787/localhost/work/output/temporalcentroids/centroids-iteration0-noOfClusters2/part-r-00000
我在使用开始工作之前添加文件
DistributedCache.addCacheFile(URI.create(args[2]), job.getConfiguration());
我正在尝试从我的映射器中的设置方法中读取文件,使用
DistributedCache.getLocalCacheFiles(conf);
正如我所说,我可以确认该文件在本地系统上,但是抛出了异常。
我在一台计算机上以伪分布式模式运行该作业。
有任何想法吗?
谢谢