有没有一种方法来设置由Hadoop的通用选项提供一个Hadoop MapReduce的本地资源的纱线知名度-files或-archives。在yarn-site.xml中查找我使用-archives选项找到了在worker节点上写入文件的位置,但是基于我读过的其他文章和它登录的目录(/ hadoop/yarn/local/usercache/myusername/appcache)它被视为私有。我找不到任何通用选项或-D some.yarn.setting将其从私有应用程序更改为应用程序或更好,公共。变化的Hadoop MapReduce的本地资源能见度PUBLIC
回答
我通过Hadoop的代码去了。这些参数(mapreduce.job.cache.files.visibilities和mapreduce.job.cache.archives.visibilities)无法通过配置进行设置。
这些参数在MRJobConfig.java定义:
public static final String CACHE_FILE_VISIBILITIES = "mapreduce.job.cache.files.visibilities";
public static final String CACHE_ARCHIVES_VISIBILITIES = "mapreduce.job.cache.archives.visibilities";
org.apache.hadoop.mapreduce.JobResourceUploader.java,具有如下功能:uploadFiles()。此功能上传的临时文件,罐子和档案馆分布式缓存:
这个功能决定的文件和档案的知名度,通过调用以下功能:
// set the public/private visibility of the archives and files
ClientDistributedCacheManager.determineTimestampsAndCacheVisibilities(conf);
上述函数调用,终于命中determineCacheVisibilities()函数在org.apache.hadoop.mapreduce.filecache.ClientDistributedCacheManager.java
按本功能的描述:
/**
* Determines the visibilities of the distributed cache files and
* archives. The visibility of a cache path is "public" if the leaf component
* has READ permissions for others, and the parent subdirs have
* EXECUTE permissions for others
* @param job
* @throws IOException
*/
public static void determineCacheVisibilities(Configuration job,
所以可见性是根据叶文件和父目录的权限确定的。
在ClientDistributedCacheManager.java,isPublic()方法具有计算能见度的逻辑:
//the leaf level file should be readable by others
if (!checkPermissionOfOther(fs, current, FsAction.READ, statCache)) {
return false;
}
return ancestorsHaveExecutePermissions(fs, current.getParent(), statCache);
最后,确定的权限之后,可见度被设定在以下的功能:
static void setArchiveVisibilities(Configuration conf, String booleans) {
conf.set(MRJobConfig.CACHE_ARCHIVES_VISIBILITIES, booleans);
}
static void setFileVisibilities(Configuration conf, String booleans) {
conf.set(MRJobConfig.CACHE_FILE_VISIBILITIES, booleans);
}
所以,即使你在命令行中指定这些配置中,配置参数不考虑。这些配置由框架本身以编程方式设置。
另外,我检查mapred-default.xml中。可见性没有默认配置参数。
你摇滚。我发布后发现了两个常量,但没有看到任何明显的方向去调查。有趣的是,我上面的评论中的Hortonworks链接隐约提到了文件的权限,但没有像你所做的那样拼写出任何内容。做得好! –
- 1. Gradle中的本地化资源变量
- 2. 资源本地化
- 3. 本地化mscorlib.dll中资源
- 4. REST和本地化资源
- 5. 资源本地化xaml
- 6. TextBlock的能见度变化WPF
- 7. LayoutTransitions不工作的能见度变化
- 8. 来自webservice的WPF资源本地化
- 9. 数据库中的本地化资源?
- 10. ILMerge和本地化的资源集合
- 11. 重复的本地化资源文件
- 12. 如何本地化与iphone的资源
- 13. iPhone - 使用本地化的资源
- 14. hadoop的Dumbo mapreduce
- 15. Hadoop中的MapReduce
- 16. Hadoop:迭代MapReduce性能
- 17. hadoop mapreduce
- 18. 如何使用WPF本地化扩展本地化资源?
- 19. ASP.NET:全球化/本地化:枚举本地资源对象
- 20. Siliverlight:控制能见度变化对齐?
- 21. 什么决定了MapReduce应用程序的本地化速度?
- 22. mapreduce中的reducers hadoop
- 23. 南希本地化 - 独立资源库
- 24. ILMerge +本地化资源集合
- 25. WP7本地化和资源文件
- 26. 本地化使用资源文件
- 27. 使用xcode 4.0.2本地化资源
- 28. 本地化 - CMS或资源文件?
- 29. 本地化的意见
- 30. 位置的本地资源
你的问题不清楚。 “从私人到公共”的含义是什么? –
我在Hadoop的源戳周围,发现字符串“mapreduce.job.cache.archives.visibilities”,它可以被设置为逗号分隔的列表(每个-archives条目显然),但设置在驱动程序配置没有按似乎没有帮助。 –
如果您看[此Hortonworks链接](http:// hortonworks。com/blog/management-of-application-dependencies-in-yarn /),您会发现可以将地图缩减作业捆绑的文件和存档的本地资源可见性从私有(默认)更改为公共和公共可见将允许文件在应用程序的运行之间持续存在。私人资源将在用户每次运行应用程序后被删除。 –