我正在使用 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/