@InterfaceAudience.Public public class GroupingTableMap extends org.apache.hadoop.mapred.MapReduceBase implements TableMap<ImmutableBytesWritable,Result>
Modifier and Type | Field and Description |
---|---|
protected byte[][] |
columns |
static String |
GROUP_COLUMNS
JobConf parameter to specify the columns used to produce the key passed to
collect from the map phase
|
Constructor and Description |
---|
GroupingTableMap() |
Modifier and Type | Method and Description |
---|---|
void |
configure(org.apache.hadoop.mapred.JobConf job) |
protected ImmutableBytesWritable |
createGroupKey(byte[][] vals)
Create a key by concatenating multiple column values.
|
protected byte[][] |
extractKeyValues(Result r)
Extract columns values from the current record.
|
static void |
initJob(String table,
String columns,
String groupColumns,
Class<? extends TableMap> mapper,
org.apache.hadoop.mapred.JobConf job)
Use this before submitting a TableMap job.
|
void |
map(ImmutableBytesWritable key,
Result value,
org.apache.hadoop.mapred.OutputCollector<ImmutableBytesWritable,Result> output,
org.apache.hadoop.mapred.Reporter reporter)
Extract the grouping columns from value to construct a new key.
|
public static final String GROUP_COLUMNS
protected byte[][] columns
public GroupingTableMap()
public static void initJob(String table, String columns, String groupColumns, Class<? extends TableMap> mapper, org.apache.hadoop.mapred.JobConf job)
table
- table to be processedcolumns
- space separated list of columns to fetchgroupColumns
- space separated list of columns used to form the key
used in collectmapper
- map classjob
- job configuration objectpublic void configure(org.apache.hadoop.mapred.JobConf job)
configure
in interface org.apache.hadoop.mapred.JobConfigurable
configure
in class org.apache.hadoop.mapred.MapReduceBase
public void map(ImmutableBytesWritable key, Result value, org.apache.hadoop.mapred.OutputCollector<ImmutableBytesWritable,Result> output, org.apache.hadoop.mapred.Reporter reporter) throws IOException
map
in interface org.apache.hadoop.mapred.Mapper<ImmutableBytesWritable,Result,ImmutableBytesWritable,Result>
key
- value
- output
- reporter
- IOException
protected byte[][] extractKeyValues(Result r)
r
- protected ImmutableBytesWritable createGroupKey(byte[][] vals)
vals
- Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.