hadoop - 文件未存储在分布式缓存中

标签 hadoop distributed-cache

我正在使用 DistributedCache。但是执行代码后缓存中没有文件。 我已经提到了其他类似的问题,但答案并没有解决我的问题。

请在下面找到代码:

   Configuration conf = new Configuration();
   Job job1 = new Job(conf, "distributed cache");
   Configuration conf1 = job1.getConfiguration();
   DistributedCache.addCacheFile(new Path("File").toUri(), conf1);
   System.out.println("distributed cache file "+DistributedCache.getLocalCacheFiles(conf1));

这给出了 null..

同样的事情在 mapper 内部给出时也会给出 null 因此。请让我知道您的建议。

谢谢

最佳答案

尝试使用 getCacheFiles() 而不是 getLocalCacheFiles()

关于hadoop - 文件未存储在分布式缓存中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16394529/

相关文章:

java - hadoop上的自定义类FileInputFormat

java - Reducer Hadoop 中的分布式缓存

java - DefaultMindAppmasterServiceClient的$ {SHDP_AMSERVICE_PORT}在哪里定义?

java - Hadoop WordCount, map 中的总和

java - Infinispan 操作模式

hadoop - Hadoop分布式缓存-修改文件

java - 目录是否由 Hadoop 缓存符号链接(symbolic link)处理?

distributed-cache - 有哪些共享状态分布式系统可以处理本地语言中的对象?

字符串转换的 Hadoop MapReduce 示例

hadoop - 您可以将 s3distcp 与 gzip 压缩输入一起使用吗?