【发布时间】:2015-01-01 06:50:28
【问题描述】:
我在我的 mapreduce 程序中使用分布式缓存,我将三个变量传递给这个 mapreduce 程序 input file、output dir 和 config file。
我想将第三个参数,即配置文件添加到分布式缓存。
我在MapReduce Driver的run()方法中设置参数如下:-
conf.set("CONF_XML", args[2]);
如何以相同的方法将此文件添加到分布式缓存中。我该怎么做?
通常我们使用URI(new (file path));添加
DistributedCache.addCacheFile(new URI(file_path), conf); << here how to pass the argument parameter?
【问题讨论】:
-
不推荐使用
DistributedCache.addCacheFile,请查看此question 以了解在新APIjob.addCacheFile()上的使用情况。
标签: caching hadoop mapreduce distributed