org.apache.hadoop.hbase.mapreduce
Class IndexTableReducer

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Reducer<ImmutableBytesWritable,Result,ImmutableBytesWritable,LuceneDocumentWrapper>
      extended by org.apache.hadoop.hbase.mapreduce.IndexTableReducer
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable

public class IndexTableReducer
extends org.apache.hadoop.mapreduce.Reducer<ImmutableBytesWritable,Result,ImmutableBytesWritable,LuceneDocumentWrapper>
implements org.apache.hadoop.conf.Configurable

Construct a Lucene document per row, which is consumed by IndexOutputFormat to build a Lucene index


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Reducer
org.apache.hadoop.mapreduce.Reducer.Context
 
Constructor Summary
IndexTableReducer()
           
 
Method Summary
 org.apache.hadoop.conf.Configuration getConf()
          Returns the current configuration.
 void reduce(ImmutableBytesWritable key, Iterable<Result> values, org.apache.hadoop.mapreduce.Reducer.Context context)
          Writes each given record, consisting of the key and the given values, to the index.
 void setConf(org.apache.hadoop.conf.Configuration configuration)
          Sets the configuration.
 
Methods inherited from class org.apache.hadoop.mapreduce.Reducer
cleanup, run, setup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexTableReducer

public IndexTableReducer()
Method Detail

reduce

public void reduce(ImmutableBytesWritable key,
                   Iterable<Result> values,
                   org.apache.hadoop.mapreduce.Reducer.Context context)
            throws IOException,
                   InterruptedException
Writes each given record, consisting of the key and the given values, to the index.

Overrides:
reduce in class org.apache.hadoop.mapreduce.Reducer<ImmutableBytesWritable,Result,ImmutableBytesWritable,LuceneDocumentWrapper>
Parameters:
key - The current row key.
values - The values for the given row.
context - The context of the reduce.
Throws:
IOException - When writing the record fails.
InterruptedException - When the job gets interrupted.

getConf

public org.apache.hadoop.conf.Configuration getConf()
Returns the current configuration.

Specified by:
getConf in interface org.apache.hadoop.conf.Configurable
Returns:
The current configuration.
See Also:
Configurable.getConf()

setConf

public void setConf(org.apache.hadoop.conf.Configuration configuration)
Sets the configuration. This is used to set up the index configuration.

Specified by:
setConf in interface org.apache.hadoop.conf.Configurable
Parameters:
configuration - The configuration to set.
See Also:
Configurable.setConf( org.apache.hadoop.conf.Configuration)


Copyright © 2009 The Apache Software Foundation