hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Parkirat <parkiratbigd...@gmail.com>
Subject Re: Hbase Mapreduce API - Reduce to a file is not working properly.
Date Sat, 02 Aug 2014 06:26:42 GMT
Hi Shahab,

Thanks for the response.

I have added the @Override and somehow that worked. I have pasted the new
Reducer code below.

Though, I did not understood the difference here, as if what I have done
differently. I might be a very silly reason though.

=========================================================
package com.test.hadoop;

import java.io.IOException;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

public class WordCountReducer extends Reducer<Text, IntWritable, Text,
IntWritable> {

	@Override
	protected void reduce(Text key, Iterable<IntWritable> values, Context
context)
			throws IOException, InterruptedException {
		
		int sum = 0;
		for (IntWritable val : values) {
			sum += val.get();
		}
		context.write(key, new IntWritable(sum));
	}
}
=========================================================

Regards,
Parkirat Bagga.



--
View this message in context: http://apache-hbase.679495.n3.nabble.com/Hbase-Mapreduce-API-Reduce-to-a-file-is-not-working-properly-tp4062141p4062240.html
Sent from the HBase User mailing list archive at Nabble.com.

Mime
View raw message