1

我的理解是

分布式模式下DistributedCache.getCacheFiles()伪分布式模式下的DistributedCache.getLocalCacheFiles()。

那么我们能否在 MapReduce 代码中检查我们是在伪模式还是分布式模式下运行

if(distributed)
 DistributedCache.getCacheFiles()
else
 DistributedCache.getLocalCacheFiles()

我们可以做这样的事情还是有更好的方法。

即使我们在相对模式下使用DistributedCache.getCacheFiles()DistributedCache.getLocalCacheFiles() , DistributedCache 也可以获取HDFS 或本地数据。

4

0 回答 0