将参数传递给Hadoop中的映射函数 [英] Passing parameters to map function in Hadoop
问题描述
我是Hadoop的新手。我想从mapper类的map函数内的主函数(Java程序)访问命令行参数。请建议如何做到这一点。
I am new to Hadoop. I want to access a command line argument from main function(Java program) inside the map function of the mapper class. Please suggest ways to do this.
推荐答案
Hadoop 0.20 ,引入了新的MR API,新的(oahmapreduce软件包)和旧的MR API(oahmapred),除了可以使用新的API在映射器和简化器中提取数据。什么是阿农提到的是旧的API。
Hadoop 0.20, introduced new MR API, there is not much functionality difference between the new (o.a.h.mapreduce package) and old MR API (o.a.h.mapred) except that data can be pulled within the mappers and the reducers using the new API. What Arnon is mentioned is with the old API.
检查此文章,用于使用新旧API传递参数。
Check this article for passing the parameters using the new and old API.
这篇关于将参数传递给Hadoop中的映射函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!