2

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?

keelar
  • 5,814
  • 7
  • 40
  • 79
  • Is `org.apache.hadoop.mapred.Mapper` a typo? – Paul Bellora Oct 11 '13 at 01:17
  • 1
    @Paul Bellora: No, it seems that hadoop has two versions of Mapper. One is under `mapred`, and the other from `mapreduce`. – keelar Oct 11 '13 at 01:18
  • I am still working on this problem, but I am wondering which change makes more sense: either using `JobControl` and re-write my Mapper to implement `mapred.Mapper`, or keep using `mapreduce.Mapper` and give up `JobControl`. – keelar Oct 11 '13 at 01:21
  • 1
    Related: [hadoop.mapred vs hadoop.mapreduce?](http://stackoverflow.com/questions/16269922/hadoop-mapred-vs-hadoop-mapreduce) – Paul Bellora Oct 11 '13 at 01:29
  • Thank you, Paul! I am now trying to throw away the `JobControl`, which is based on `mapred` library, and finding better way to connect jobs :~~. – keelar Oct 11 '13 at 01:32
  • 1
    Well I found this class when searching: [`org.apache.hadoop.mapreduce.lib.jobcontrol.JobControl`](http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/lib/jobcontrol/JobControl.html) Is that the answer? I don't quite get the `JobConf` connection (no Hadoop experience). – Paul Bellora Oct 11 '13 at 01:34
  • Wow, that might be the answer! I was using `org.apache.hadoop.mapred.jobcontrol.Jobcontrol` and didn't know the one you found! – keelar Oct 11 '13 at 01:39
  • Now I have tons of compile errors to fix. I will later come back and post after I changed to mapreduce.lib.jobcontrol.JobControl. Thank you !! – keelar Oct 11 '13 at 01:41
  • Glad to help! I'll go ahead and put that in an answer. – Paul Bellora Oct 11 '13 at 01:43

1 Answers1

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?

Community
  • 1
  • 1
Paul Bellora
  • 54,340
  • 18
  • 130
  • 181