public class Inv2DirectMultiReduce extends HadoopUtility.MapReduceBase<org.apache.hadoop.io.IntWritable,Wrapper<IterablePosting>,org.apache.hadoop.io.VIntWritable,Posting,Object,Object>
| Modifier and Type | Class and Description |
|---|---|
static class |
Inv2DirectMultiReduce.ByDocidPartitioner<K>
Partitioner partitioning by docid
|
static class |
Inv2DirectMultiReduce.ByDocidPartitionerPosting
Partitioner partitioning by docid
|
static class |
Inv2DirectMultiReduce.Inv2DirectMultiReduceJob
This class performs contains setup for the MR job.
|
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.hadoop.mapred.JobConf |
jc |
| Constructor and Description |
|---|
Inv2DirectMultiReduce() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Called at end of map or reduce task.
|
protected void |
closeMap() |
protected void |
closeReduce() |
void |
configure(org.apache.hadoop.mapred.JobConf _jc) |
protected void |
configureMap() |
protected void |
configureReduce() |
static void |
invertStructure(IndexOnDisk index,
HadoopPlugin.JobFactory jf,
int numberOfReduceTasks)
Performs the inversion, from "inverted" structure to "direct" structure.
|
static void |
main(String[] args)
main
|
void |
map(org.apache.hadoop.io.IntWritable termId,
Wrapper<IterablePosting> postingWrapper,
org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.VIntWritable,Posting> collector,
org.apache.hadoop.mapred.Reporter reporter)
Take an iterator of postings.
|
void |
reduce(org.apache.hadoop.io.VIntWritable _targetDocid,
Iterator<Posting> documentPostings,
org.apache.hadoop.mapred.OutputCollector<Object,Object> collector,
org.apache.hadoop.mapred.Reporter reporter) |
public static void main(String[] args) throws Exception
args - Exceptionpublic static void invertStructure(IndexOnDisk index, HadoopPlugin.JobFactory jf, int numberOfReduceTasks) throws Exception
index - - the index to perform the inversion onjf - - MapReduce job factorynumberOfReduceTasks - - as it says. More is better.Exceptionprotected void configureMap()
throws IOException
IOExceptionpublic void map(org.apache.hadoop.io.IntWritable termId,
Wrapper<IterablePosting> postingWrapper,
org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.VIntWritable,Posting> collector,
org.apache.hadoop.mapred.Reporter reporter)
throws IOException
IOExceptionprotected void closeMap()
throws IOException
IOExceptionprotected void configureReduce()
throws IOException
IOExceptionpublic void reduce(org.apache.hadoop.io.VIntWritable _targetDocid,
Iterator<Posting> documentPostings,
org.apache.hadoop.mapred.OutputCollector<Object,Object> collector,
org.apache.hadoop.mapred.Reporter reporter)
throws IOException
IOExceptionprotected void closeReduce()
throws IOException
IOExceptionpublic void configure(org.apache.hadoop.mapred.JobConf _jc)
configure in interface org.apache.hadoop.mapred.JobConfigurablepublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionTerrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow