|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.mapreduce.Mapper<ImmutableBytesWritable,Result,KEYOUT,VALUEOUT>
org.apache.hadoop.hbase.mapreduce.TableMapper<ImmutableBytesWritable,Result>
org.apache.hadoop.hbase.mapreduce.GroupingTableMapper
@InterfaceAudience.Public @InterfaceStability.Stable public class GroupingTableMapper
Extract grouping columns from input record.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper |
|---|
org.apache.hadoop.mapreduce.Mapper.Context |
| Field Summary | |
|---|---|
protected byte[][] |
columns
The grouping columns. |
static String |
GROUP_COLUMNS
JobConf parameter to specify the columns used to produce the key passed to collect from the map phase. |
| Constructor Summary | |
|---|---|
GroupingTableMapper()
|
|
| Method Summary | |
|---|---|
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. |
org.apache.hadoop.conf.Configuration |
getConf()
Returns the current configuration. |
static void |
initJob(String table,
Scan scan,
String groupColumns,
Class<? extends TableMapper> mapper,
org.apache.hadoop.mapreduce.Job job)
Use this before submitting a TableMap job. |
void |
map(ImmutableBytesWritable key,
Result value,
org.apache.hadoop.mapreduce.Mapper.Context context)
Extract the grouping columns from value to construct a new key. |
void |
setConf(org.apache.hadoop.conf.Configuration configuration)
Sets the configuration. |
| Methods inherited from class org.apache.hadoop.mapreduce.Mapper |
|---|
cleanup, run, setup |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String GROUP_COLUMNS
protected byte[][] columns
| Constructor Detail |
|---|
public GroupingTableMapper()
| Method Detail |
|---|
public static void initJob(String table,
Scan scan,
String groupColumns,
Class<? extends TableMapper> mapper,
org.apache.hadoop.mapreduce.Job job)
throws IOException
table - The table to be processed.scan - The scan with the columns etc.groupColumns - A space separated list of columns used to form the
key used in collect.mapper - The mapper class.job - The current job.
IOException - When setting up the job fails.
public void map(ImmutableBytesWritable key,
Result value,
org.apache.hadoop.mapreduce.Mapper.Context context)
throws IOException,
InterruptedException
map in class org.apache.hadoop.mapreduce.Mapper<ImmutableBytesWritable,Result,ImmutableBytesWritable,Result>key - The current key.value - The current value.context - The current context.
IOException - When writing the record fails.
InterruptedException - When the job is aborted.protected byte[][] extractKeyValues(Result r)
Override this method if you want to deal with nulls differently.
r - The current values.
protected ImmutableBytesWritable createGroupKey(byte[][] vals)
Override this function in order to produce different types of keys.
vals - The current key/values.
public org.apache.hadoop.conf.Configuration getConf()
getConf in interface org.apache.hadoop.conf.ConfigurableConfigurable.getConf()public void setConf(org.apache.hadoop.conf.Configuration configuration)
setConf in interface org.apache.hadoop.conf.Configurableconfiguration - The configuration to set.Configurable.setConf(
org.apache.hadoop.conf.Configuration)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||