eu.dicodeproject.analysis.generic
Class GenericTableReducer
java.lang.Object
org.apache.hadoop.mapreduce.Reducer<KEYIN,VALUEIN,KEYOUT,org.apache.hadoop.io.Writable>
org.apache.hadoop.hbase.mapreduce.TableReducer<org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.Text,org.apache.hadoop.hbase.io.ImmutableBytesWritable>
eu.dicodeproject.analysis.generic.GenericTableReducer
public class GenericTableReducer
- extends org.apache.hadoop.hbase.mapreduce.TableReducer<org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.Text,org.apache.hadoop.hbase.io.ImmutableBytesWritable>
Sums up counts for hashtags (or more general: words) and writes the counts to
HBase.
| Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Reducer |
org.apache.hadoop.mapreduce.Reducer.Context |
|
Method Summary |
protected void |
cleanup(org.apache.hadoop.mapreduce.Reducer.Context context)
Write data if < Limit |
void |
reduce(org.apache.hadoop.io.IntWritable key,
Iterable<org.apache.hadoop.io.Text> values,
org.apache.hadoop.mapreduce.Reducer.Context context)
Aggregates top Hashtags in JSON format write to HBase |
protected void |
setup(org.apache.hadoop.mapreduce.Reducer.Context context)
Creates the Row Key from current date and query/topic |
| Methods inherited from class org.apache.hadoop.mapreduce.Reducer |
run |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GenericTableReducer
public GenericTableReducer()
setup
protected void setup(org.apache.hadoop.mapreduce.Reducer.Context context)
throws IOException,
InterruptedException
- Creates the Row Key from current date and query/topic
- Overrides:
setup in class org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.Text,org.apache.hadoop.hbase.io.ImmutableBytesWritable,org.apache.hadoop.io.Writable>
- Throws:
IOException
InterruptedException
reduce
public void reduce(org.apache.hadoop.io.IntWritable key,
Iterable<org.apache.hadoop.io.Text> values,
org.apache.hadoop.mapreduce.Reducer.Context context)
throws IOException,
InterruptedException
- Aggregates top Hashtags in JSON format write to HBase
- Overrides:
reduce in class org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.Text,org.apache.hadoop.hbase.io.ImmutableBytesWritable,org.apache.hadoop.io.Writable>
- Throws:
IOException
InterruptedException
cleanup
protected void cleanup(org.apache.hadoop.mapreduce.Reducer.Context context)
throws IOException,
InterruptedException
- Write data if < Limit
- Overrides:
cleanup in class org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.Text,org.apache.hadoop.hbase.io.ImmutableBytesWritable,org.apache.hadoop.io.Writable>
- Throws:
IOException
InterruptedException
Copyright © 2011. All Rights Reserved.