org.apache.hadoop.hbase.mapreduce
Class IdentityTableMapper

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Mapper<ImmutableBytesWritable,Result,KEYOUT,VALUEOUT>
      extended by org.apache.hadoop.hbase.mapreduce.TableMapper<ImmutableBytesWritable,Result>
          extended by 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 Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper
org.apache.hadoop.mapreduce.Mapper.Context
 
Constructor Summary
IdentityTableMapper()
           
 
Method Summary
static void initJob(String table, Scan scan, 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)
          Pass the key, value to reduce.
 
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
 

Constructor Detail

IdentityTableMapper

public IdentityTableMapper()
Method Detail

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.