org.apache.hadoop.hbase.mapred
Class TableMap<K extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable>

java.lang.Object
  extended by org.apache.hadoop.mapred.MapReduceBase
      extended by org.apache.hadoop.hbase.mapred.TableMap<K,V>
All Implemented Interfaces:
org.apache.hadoop.io.Closeable, org.apache.hadoop.mapred.JobConfigurable, org.apache.hadoop.mapred.Mapper<HStoreKey,org.apache.hadoop.io.MapWritable,K,V>
Direct Known Subclasses:
GroupingTableMap, IdentityTableMap

public abstract class TableMap<K extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable>
extends org.apache.hadoop.mapred.MapReduceBase
implements org.apache.hadoop.mapred.Mapper<HStoreKey,org.apache.hadoop.io.MapWritable,K,V>

Scan an HBase table to sort by a specified sort column. If the column does not exist, the record is not passed to Reduce.


Constructor Summary
TableMap()
           
 
Method Summary
static void initJob(String table, String columns, Class<? extends TableMap> mapper, org.apache.hadoop.mapred.JobConf job)
          Use this before submitting a TableMap job.
abstract  void map(HStoreKey key, org.apache.hadoop.io.MapWritable value, org.apache.hadoop.mapred.OutputCollector<K,V> output, org.apache.hadoop.mapred.Reporter reporter)
          Call a user defined function on a single HBase record, represented by a key and its associated record value.
 
Methods inherited from class org.apache.hadoop.mapred.MapReduceBase
close, configure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.mapred.JobConfigurable
configure
 
Methods inherited from interface org.apache.hadoop.io.Closeable
close
 

Constructor Detail

TableMap

public TableMap()
Method Detail

initJob

public static void initJob(String table,
                           String columns,
                           Class<? extends TableMap> mapper,
                           org.apache.hadoop.mapred.JobConf job)
Use this before submitting a TableMap job. It will appropriately set up the JobConf.

Parameters:
table - table name
columns - columns to scan
mapper - mapper class
job - job configuration

map

public abstract void map(HStoreKey key,
                         org.apache.hadoop.io.MapWritable value,
                         org.apache.hadoop.mapred.OutputCollector<K,V> output,
                         org.apache.hadoop.mapred.Reporter reporter)
                  throws IOException
Call a user defined function on a single HBase record, represented by a key and its associated record value.

Specified by:
map in interface org.apache.hadoop.mapred.Mapper<HStoreKey,org.apache.hadoop.io.MapWritable,K extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable>
Parameters:
key -
value -
output -
reporter -
Throws:
IOException


Copyright © 2008 The Apache Software Foundation