hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Per Jacobsson" <...@pjacobsson.com>
Subject Re: error with inout for the Reduce method
Date Sun, 09 Nov 2008 23:44:13 GMT
Change the name of the reduce method to be all lower case -- "public void
reduce(..."

Right now the compiler is complaining that you haven't overridden the
correct abstract method in the base class.
/ Per

On Sat, Nov 8, 2008 at 10:44 PM, pols cut <pols_cut@yahoo.co.in> wrote:

>   I am trying to get a simple map reduce function going but getting the
> following error. could anyone please help/guide me
>
> filename.java is not abstract and does not override abstract method
> reduce<org.apache.io.text,java.util.iterator<org.apache.hadoop.io.text>,org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.Text.org.apache.hadoop.mapred.Reporter>
> in org.apache.hadoop.mapred.Reducer
> public static class Reduce extends MapReduceBase implements
> Reducer<Text,Text,Text,Text>
>
>
> My Map method is like this:
> public static class map extends MapReduceBase implements
> Mapper<LongWritable, Text, Text, Text>
>    {
> public void map(LongWritable key, Text value, OutputCollector<Text, Text>
> output, Reporter reporter) throws IOException
>        {
>  output.collect(word_key,new Text(str1));  //output.collect(Text,Text)
>
>            }
>
>    }
>
> public static class Reduce extends MapReduceBase implements Reducer<Text,
> Text, Text, Text>
>    {
>
>    public void Reduce(Text key, Iterator<Text> values,
> OutputCollector<Text, Text> output, Reporter reporter) throws IOException
>       {
>              output.collect(new Text("Test"), new Text("Me"));
>
>      }
>   }
>
> configuration is like :
>
>        conf.setMapOutputKeyClass(Text.class);
>        conf.setMapOutputValueClass(Text.class);
>        conf.setOutputKeyClass(Text.class);
>        conf.setOutputValueClass(Text.class);
>
>        conf.setMapperClass(map.class);
>        conf.setCombinerClass(Reduce.class);
>        conf.setReducerClass(Reduce.class);
>
>        conf.setInputFormat(TextInputFormat.class);
>        conf.setOutputFormat(TextOutputFormat.class);
>
>
>      Add more friends to your messenger and enjoy! Go to
> http://messenger.yahoo.com/invite/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message