【发布时间】:2012-12-06 15:10:09
【问题描述】:
我想使用分布式缓存来允许我的映射器访问数据。我主要使用命令
DistributedCache.addCacheFile(new URI("/user/peter/cacheFile/testCache1"), conf);
其中 /user/peter/cacheFile/testCache1 是存在于 hdfs 中的文件
然后,我的设置函数如下所示:
public void setup(Context context) throws IOException, InterruptedException{
Configuration conf = context.getConfiguration();
Path[] localFiles = DistributedCache.getLocalCacheFiles(conf);
//etc
}
但是,这个 localFiles 数组始终为空。
我最初在单主机集群上运行以进行测试,但我读到这将阻止分布式缓存工作。我尝试了一个伪分布式,但这也没有用
我正在使用 hadoop 1.0.3
谢谢 彼得
【问题讨论】:
标签: hadoop