@InterfaceAudience.Public @InterfaceStability.Stable public class GroupingTableMap extends 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(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,
JobConf job)
Use this before submitting a TableMap job.
|
void |
map(ImmutableBytesWritable key,
Result value,
<any> output,
Reporter reporter)
Extract the grouping columns from value to construct a new key.
|
public static final String GROUP_COLUMNS
protected byte[][] columns
public static void initJob(String table, String columns, String groupColumns, Class<? extends TableMap> mapper, 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(JobConf job)
public void map(ImmutableBytesWritable key, Result value, <any> output, Reporter reporter) throws IOException
key - value - output - reporter - IOExceptionprotected byte[][] extractKeyValues(Result r)
r - protected ImmutableBytesWritable createGroupKey(byte[][] vals)
vals -