Skip navigation links
oracle.hadoop.balancer.examples.invindx
Class InvertedIndexMapreduce.InvertedIndexReducer
java.lang.Object
org.apache.hadoop.mapreduce.Reducer<InvertedIndex.InvertedIndexKey,InvertedIndex.InvertedIndexValue,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
oracle.hadoop.balancer.examples.invindx.InvertedIndexMapreduce.InvertedIndexReducer
- Enclosing class:
- InvertedIndexMapreduce
-
public static class InvertedIndexMapreduce.InvertedIndexReducer
- extends org.apache.hadoop.mapreduce.Reducer<InvertedIndex.InvertedIndexKey,InvertedIndex.InvertedIndexValue,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
The inverted index reducer class for mapreduce API
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Reducer |
org.apache.hadoop.mapreduce.Reducer.Context |
Methods inherited from class org.apache.hadoop.mapreduce.Reducer |
run |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InvertedIndexMapreduce.InvertedIndexReducer
public InvertedIndexMapreduce.InvertedIndexReducer()
reduce
public void reduce(InvertedIndex.InvertedIndexKey key,
java.lang.Iterable<InvertedIndex.InvertedIndexValue> values,
org.apache.hadoop.mapreduce.Reducer.Context context)
throws java.io.IOException,
java.lang.InterruptedException
- The reduce function. The output per line is:
- word <location:offset:numOccurrencesAtOffset>
Since the values per key are in sorted order, we can merge consecutive duplicate locations per word.
-
- Overrides:
reduce
in class org.apache.hadoop.mapreduce.Reducer<InvertedIndex.InvertedIndexKey,InvertedIndex.InvertedIndexValue,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
-
- Throws:
java.io.IOException
java.lang.InterruptedException
setup
public void setup(org.apache.hadoop.mapreduce.Reducer.Context context)
-
- Overrides:
setup
in class org.apache.hadoop.mapreduce.Reducer<InvertedIndex.InvertedIndexKey,InvertedIndex.InvertedIndexValue,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
Skip navigation links
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.