Map reduce failure for patent count



0
i am facing the following error while running the map reduce for patent count.

Task Id : attempt_201501242007_0006_m_000002_0, Status : FAILED
Task attempt_201501242007_0006_m_000002_0 failed to report status for 63 seconds. Killing!
Task attempt_201501242007_0006_m_000002_0 failed to report status for 60 seconds. Killing!
15/01/24 22:02:37 INFO mapred.JobClient: Task Id : attempt_201501242007_0006_m_000003_0, Status : FAILED
Task attempt_201501242007_0006_m_000003_0 failed to report status for 63 seconds. Killing!
Task attempt_201501242007_0006_m_000003_0 failed to report status for 60 seconds. Killing!
15/01/24 22:02:39 INFO mapred.JobClient: Task Id : attempt_201501242007_0006_r_000000_0, Status : FAILED
Task attempt_201501242007_0006_r_000000_0 failed to report status for 63 seconds. Killing!
Task attempt_201501242007_0006_r_000000_0 failed to report status for 60 seconds. Killing!

Map job completed but reducer fails..

package com.hadoop.trial;

import java.io.IOException;
import java.util.Iterator;

import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.FileInputFormat;
import org.apache.hadoop.mapred.FileOutputFormat;
import org.apache.hadoop.mapred.JobClient;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.MapReduceBase;
import org.apache.hadoop.mapred.Mapper;
import org.apache.hadoop.mapred.OutputCollector;
import org.apache.hadoop.mapred.Reducer;
import org.apache.hadoop.mapred.Reporter;
import org.apache.hadoop.mapred.TextInputFormat;
import org.apache.hadoop.mapred.TextOutputFormat;

public class PatentCount {

public static class Map extends MapReduceBase implements Mapper{

private final static IntWritable one = new IntWritable(1);
private Text patentYear = new Text();

@Override
public void map(LongWritable key, Text value, OutputCollector output,
Reporter report) throws IOException {
String line = value.toString();
String[] tokens = line.split(",");
patentYear.set(tokens[1]);
output.collect(patentYear, one);

}

}

public static class Reduce extends MapReduceBase implements Reducer{

@Override
public void reduce(Text key, Iterator values,
OutputCollector output, Reporter report) throws IOException {
int sum = 0;
while (values.hasNext()) {
sum += values.next().get();
}
output.collect(key, new IntWritable(sum));

}

}

public static void main(String[] args) throws Exception {
JobConf conf = new JobConf(PatentCount.class);
conf.setJobName("PatentCount");

conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(IntWritable.class);

conf.setMapperClass(Map.class);
conf.setCombinerClass(Reduce.class);
conf.setReducerClass(Reduce.class);

conf.setInputFormat(TextInputFormat.class);
conf.setOutputFormat(TextOutputFormat.class);

FileInputFormat.setInputPaths(conf, new Path(args[0]));
FileOutputFormat.setOutputPath(conf, new Path(args[1]));

JobClient.runJob(conf);
}

}

1 Answer(s)


0

hi Hariharan,

Can you goto mapreduce admin page (open firefox in the VM and click on the bookmark link mapreduce administration) and check the actual error for this job.

Thanks

Your Answer

Click on this code-snippet-icon icon to add code snippet.

Upload Files (Maximum image file size - 1.5 MB, other file size - 10 MB, total size - not more than 50 MB)

Email
Password