public class HadoopRunWriter extends RunWriter
Modifier and Type | Field and Description |
---|---|
protected int |
flushNo
flushNo is the number of times this map task is being flushed
|
protected String |
mapId
map task id that is being flushed
|
protected org.apache.hadoop.mapred.OutputCollector<SplitEmittedTerm,MapEmittedPostingList> |
outputCollector
output collector of Map task
|
protected int |
splitId
The id for this split within the map task that is being flushed
|
Constructor and Description |
---|
HadoopRunWriter(org.apache.hadoop.mapred.OutputCollector<SplitEmittedTerm,MapEmittedPostingList> _outputCollector,
String _mapId,
int _splitId,
int _flushNo)
Create a new HadoopRunWriter, specifying the output collector of the map task
the run number and the flush number.
|
Modifier and Type | Method and Description |
---|---|
void |
beginWrite(int maxSize,
int size)
Writes the headers of the run.
|
void |
finishWrite()
Closes the output streams.
|
boolean |
writeSorted()
This RunWriter does not require that the output be sorted.
|
void |
writeTerm(String term,
Posting post)
Write the posting to the output collector
|
protected org.apache.hadoop.mapred.OutputCollector<SplitEmittedTerm,MapEmittedPostingList> outputCollector
protected String mapId
protected int flushNo
protected int splitId
public HadoopRunWriter(org.apache.hadoop.mapred.OutputCollector<SplitEmittedTerm,MapEmittedPostingList> _outputCollector, String _mapId, int _splitId, int _flushNo)
_outputCollector
- where to emit the posting lists to_mapId
- the task id of the map currently being processed_flushNo
- the number of times that this map task has flushedpublic void beginWrite(int maxSize, int size) throws IOException
RunWriter
beginWrite
in class RunWriter
maxSize
- max size of a posting.size
- number of postings in the run.IOException
- if an I/O error occurs.public void writeTerm(String term, Posting post) throws IOException
writeTerm
in class RunWriter
term
- the term to write.post
- the Posting with the data of the term.IOException
- if an I/O error occurs.public void finishWrite() throws IOException
RunWriter
finishWrite
in class RunWriter
IOException
- if an I/O error occurs.public boolean writeSorted()
writeSorted
in class RunWriter
Terrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow