【发布时间】:2014-02-09 23:03:10
【问题描述】:
我的地图任务需要一些配置数据,我想通过分布式缓存分发这些数据。
Hadoop的MapReduce Tutorial显示了DistributedCache类的usage,大致如下:
// In the driver
JobConf conf = new JobConf(getConf(), WordCount.class);
...
DistributedCache.addCacheFile(new Path(filename).toUri(), conf);
// In the mapper
Path[] myCacheFiles = DistributedCache.getLocalCacheFiles(job);
...
但是,DistributedCache 在 Hadoop 2.2.0 中是 marked as deprecated。
实现这一目标的新首选方法是什么?是否有涵盖此 API 的最新示例或教程?
【问题讨论】: