hadoop 1.2.1版本 中 调用distributedCache时候不能用别名
https://www.imooc.com/video/15788
提示:java.io.FileNotFoundException: matrix2
代码如下:
DistributedCache.addCacheFile(new URI(uriWithLink), conf);
在eclipse下运行,提示:
WARN mapred.LocalJobRunner: LocalJobRunner does not support symlinking into current working dir.
意思是当前不支持别名。
又查了相关symlink,http://www.dataguru.cn/thread-301807-1-1.html,mapred.create.symlink 需要更改升级hadoop,故作罢,直接引用 。
Path[] caches = DistributedCache.getLocalCacheFiles(context .getConfiguration());
FileReader reader2 = new FileReader(caches[0].toString());
就可以找到文件了