hadoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Nauroth <cnaur...@hortonworks.com>
Subject Re: Deprecation Error
Date Thu, 16 Apr 2015 17:56:27 GMT
Hello Anand,

MapReduce provides 2 similar but slightly different public APIs for writing jobs.  The original
API is in the org.apache.hadoop.mapred package, and a revised version is in the org.apache.hadoop.mapreduce
package.  The JavaDocs provide examples of both:

http://hadoop.apache.org/docs/r2.6.0/api/org/apache/hadoop/mapred/JobConf.html

http://hadoop.apache.org/docs/r2.6.0/api/org/apache/hadoop/mapreduce/Job.html

A common problem is attempting to mix classes from one package with classes from the other
package.  For example, you might be trying to call org.apache.hadoop.mapreduce.Job#setMapperClass
with a class that implements org.apache.hadoop.mapred.Mapper instead of subclassing org.apache.hadoop.mapreduce.Mapper.

I hope this helps.

Chris Nauroth
Hortonworks
http://hortonworks.com/


From: Anand Murali <anand_vihar@yahoo.com<mailto:anand_vihar@yahoo.com>>
Reply-To: "user@hadoop.apache.org<mailto:user@hadoop.apache.org>" <user@hadoop.apache.org<mailto:user@hadoop.apache.org>>,
Anand Murali <anand_vihar@yahoo.com<mailto:anand_vihar@yahoo.com>>
Date: Tuesday, April 14, 2015 at 2:52 AM
To: "user@hadoop.apache.org<mailto:user@hadoop.apache.org>" <user@hadoop.apache.org<mailto:user@hadoop.apache.org>>
Subject: Deprecation Error

Hi:

I am using Tom Whyte's text book on Hadoop 2.X for learning. However I have installed 2.6
and using text code to get started. I get the following error on the main class


anand_vihar@Latitude-E5540:~/hadoop-2.6.0/code$ javac -classpath $(hadoop classpath) MaxTemperature.java
MaxTemperature.java:25: error: cannot find symbol
        job.setMapperClass(MaxTemperatureMapper.class);
                           ^
  symbol:   class MaxTemperatureMapper
  location: class MaxTemperature
MaxTemperature.java:26: error: cannot find symbol
        job.setReducerClass(MaxTemperatureReducer.class);
                            ^
  symbol:   class MaxTemperatureReducer
  location: class MaxTemperature
Note: MaxTemperature.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors

Can somebody advise me what are the equivalent API for setMapperClass/SetReducer class, and
where I can find the delta differences between 2.x and 2,6.


Thanks,

Regards,



Anand Murali
11/7, 'Anand Vihar', Kandasamy St, Mylapore
Chennai - 600 004, India
Ph: (044)- 28474593/ 43526162 (voicemail)

Mime
View raw message