org.apache.hadoop.hbase.mapred
Class TableReduce

java.lang.Object
  extended by org.apache.hadoop.mapred.MapReduceBase
      extended by org.apache.hadoop.hbase.mapred.TableReduce
All Implemented Interfaces:
Closeable, JobConfigurable, Reducer
Direct Known Subclasses:
IdentityTableReduce

public abstract class TableReduce
extends MapReduceBase
implements Reducer

Write a table, sorting by the input key


Constructor Summary
TableReduce()
          Constructor
 
Method Summary
static void initJob(String table, Class<? extends TableReduce> reducer, JobConf job)
          Use this before submitting a TableReduce job.
abstract  void reduce(Text key, Iterator values, TableOutputCollector output, Reporter reporter)
           
 void reduce(WritableComparable key, Iterator values, OutputCollector output, Reporter reporter)
          Create a unique key for table insertion by appending a local counter the given key.
 
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

TableReduce

public TableReduce()
Constructor

Method Detail

initJob

public static void initJob(String table,
                           Class<? extends TableReduce> reducer,
                           JobConf job)
Use this before submitting a TableReduce job. It will appropriately set up the JobConf.

Parameters:
table -
reducer -
job -

reduce

public void reduce(WritableComparable key,
                   Iterator values,
                   OutputCollector output,
                   Reporter reporter)
            throws IOException
Create a unique key for table insertion by appending a local counter the given key.

Specified by:
reduce in interface Reducer
Parameters:
key - the key.
values - the list of values to reduce.
output - to collect keys and combined values.
reporter - facility to report progress.
Throws:
IOException
See Also:
Reducer.reduce(org.apache.hadoop.io.WritableComparable, java.util.Iterator, org.apache.hadoop.mapred.OutputCollector, org.apache.hadoop.mapred.Reporter)

reduce

public abstract void reduce(Text key,
                            Iterator values,
                            TableOutputCollector output,
                            Reporter reporter)
                     throws IOException
Parameters:
key -
values -
output -
reporter -
Throws:
IOException


Copyright © 2006 The Apache Software Foundation