org.apache.hadoop.hbase.mapreduce
Class IdentityTableMapper
java.lang.Object
org.apache.hadoop.mapreduce.Mapper<ImmutableBytesWritable,Result,KEYOUT,VALUEOUT>
org.apache.hadoop.hbase.mapreduce.TableMapper<ImmutableBytesWritable,Result>
org.apache.hadoop.hbase.mapreduce.IdentityTableMapper
public class IdentityTableMapper
- extends TableMapper<ImmutableBytesWritable,Result>
Pass the given key and record as-is to the reduce phase.
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper |
org.apache.hadoop.mapreduce.Mapper.Context |
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 |
IdentityTableMapper
public IdentityTableMapper()
initJob
public static void initJob(String table,
Scan scan,
Class<? extends TableMapper> mapper,
org.apache.hadoop.mapreduce.Job job)
throws IOException
- Use this before submitting a TableMap job. It will appropriately set up
the job.
- Parameters:
table
- The table name.scan
- The scan with the columns to scan.mapper
- The mapper class.job
- The job configuration.
- Throws:
IOException
- When setting up the job fails.
map
public void map(ImmutableBytesWritable key,
Result value,
org.apache.hadoop.mapreduce.Mapper.Context context)
throws IOException,
InterruptedException
- Pass the key, value to reduce.
- Overrides:
map
in class org.apache.hadoop.mapreduce.Mapper<ImmutableBytesWritable,Result,ImmutableBytesWritable,Result>
- Parameters:
key
- The current key.value
- The current value.context
- The current context.
- Throws:
IOException
- When writing the record fails.
InterruptedException
- When the job is aborted.
Copyright © 2011 The Apache Software Foundation. All Rights Reserved.