JobControl and JofConf.setMapperClass() error

[亡魂溺海] 提交于 2019-12-11 01:33:10

问题


I am trying to use JobControl to connect multiple Mappers and Reducers together but encounter the following error when invoking JobConf.setMapperClass:

setMapperClass(java.lang.Class<? extends org.apache.hadoop.mapred.Mapper>) in
    org.apache.hadoop.mapred.JobConf cannot be applied to
    (java.lang.Class<capture#530 of ? extends org.apache.hadoop.mapreduce.Mapper>)

It seems that java complains my implementation of Mapper, which is based on mapreduce.Mapper, while JobControl takes mapred.Mapper. (am I right on this part?)

Now my question is: should I keep using mapreduce.Mapper and give up JobControl and find something else to connect my jobs, or change my implementation to mapred.Mapper and keep using JobControl. Is one of them considered depreciated?


回答1:


As discussed in the comments, the mapred and mapreduce packages are distinct from each other, with mapreduce being the newer, cleaner one. The differences are further discussed on this post: hadoop.mapred vs hadoop.mapreduce?

So for your particular issue, it seems like you want to use org.apache.hadoop.mapreduce.lib.jobcontrol.JobControl instead of org.apache.hadoop.mapred.jobcontrol.JobControl.

See also: Is it better to use the mapred or the mapreduce package to create a Hadoop Job?



来源:https://stackoverflow.com/questions/19307657/jobcontrol-and-jofconf-setmapperclass-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!