我正在使用以下命令向Hadoop的分布式缓存添加一个文件
Configuration cng=new Configuration();
JobConf conf = new JobConf(cng, Driver.class);
DistributedCache.addCacheFile(new Path("DCache/Orders.txt").toUri(), cng);其中,DCache/Orders.txt是HDFS中的文件。
当我尝试在mapper的configure方法中从缓存中检索这个文件时,使用:
Path[] cacheFiles=DistributedCache.getLocalCacheFiles(conf);我得到空指针。可能的错误是什么?
谢谢
发布于 2010-08-04 08:19:24
DistributedCache不能在单节点模式下工作,它只返回一个空指针。或者至少这是我在当前版本中的经验。
我认为url应该以hdfs标识符开头。
http://hadoop.apache.org/common/docs/current/mapred_tutorial.html#DistributedCache
https://stackoverflow.com/questions/3164771
复制相似问题