org.apache.solr.hadoop
Class SolrReducer

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.Text,SolrInputDocumentWritable,org.apache.hadoop.io.Text,SolrInputDocumentWritable>
      extended by org.apache.solr.hadoop.SolrReducer

public class SolrReducer
extends org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.Text,SolrInputDocumentWritable,org.apache.hadoop.io.Text,SolrInputDocumentWritable>

This class loads the mapper's SolrInputDocuments into one EmbeddedSolrServer per reducer. Each such reducer and Solr server can be seen as a (micro) shard. The Solr servers store their data in HDFS. More specifically, this class consumes a list of <docId, SolrInputDocument> pairs, sorted by docId, and sends them to an embedded Solr server to generate a Solr index shard from the documents.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Reducer
org.apache.hadoop.mapreduce.Reducer.Context
 
Field Summary
static String UPDATE_CONFLICT_RESOLVER
           
 
Constructor Summary
SolrReducer()
           
 
Method Summary
protected  void cleanup(org.apache.hadoop.mapreduce.Reducer.Context context)
           
protected  void reduce(org.apache.hadoop.io.Text key, Iterable<SolrInputDocumentWritable> values, org.apache.hadoop.mapreduce.Reducer.Context context)
           
protected  void setup(org.apache.hadoop.mapreduce.Reducer.Context context)
           
 
Methods inherited from class org.apache.hadoop.mapreduce.Reducer
run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UPDATE_CONFLICT_RESOLVER

public static final String UPDATE_CONFLICT_RESOLVER
Constructor Detail

SolrReducer

public SolrReducer()
Method Detail

setup

protected void setup(org.apache.hadoop.mapreduce.Reducer.Context context)
              throws IOException,
                     InterruptedException
Overrides:
setup in class org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.Text,SolrInputDocumentWritable,org.apache.hadoop.io.Text,SolrInputDocumentWritable>
Throws:
IOException
InterruptedException

reduce

protected void reduce(org.apache.hadoop.io.Text key,
                      Iterable<SolrInputDocumentWritable> values,
                      org.apache.hadoop.mapreduce.Reducer.Context context)
               throws IOException,
                      InterruptedException
Overrides:
reduce in class org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.Text,SolrInputDocumentWritable,org.apache.hadoop.io.Text,SolrInputDocumentWritable>
Throws:
IOException
InterruptedException

cleanup

protected void cleanup(org.apache.hadoop.mapreduce.Reducer.Context context)
                throws IOException,
                       InterruptedException
Overrides:
cleanup in class org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.Text,SolrInputDocumentWritable,org.apache.hadoop.io.Text,SolrInputDocumentWritable>
Throws:
IOException
InterruptedException


Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.