|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.gla.terrier.structures.indexing.singlepass.RunsMerger
public class RunsMerger
Merges a set of N runs using a priority queue. Each element of the queue is a RunIterator
each one pointing at a different run in disk. Each run is sorted, so we only need to compare the heads of the
element in the queue in each merging step.
As the runs are being merged, they are written (to disk) using a BitOut
.
Nested Class Summary | |
---|---|
static class |
RunsMerger.PostingComparator
Implements a comparator for RunIterators (so it can be used by the queue). |
Constructor Summary | |
---|---|
RunsMerger(RunIteratorFactory _runsSource)
|
Method Summary | |
---|---|
void |
beginMerge(int size,
java.lang.String fileName)
Begins the multiway merging phase. |
void |
endMerge(LexiconOutputStream lexStream)
Ends the merging phase, writes the last entry and closes the streams. |
int |
getBitOffset()
|
BitOut |
getBos()
|
long |
getByteOffset()
|
int |
getLastDocFreq()
|
int |
getLastFreq()
|
java.lang.String |
getLastTermWritten()
|
int |
getNumberOfPointers()
|
int |
getNumberOfTerms()
|
boolean |
isDone()
Indicates whether the merging is done or not |
void |
mergeOne(LexiconOutputStream lexStream)
Mergers one term in the runs. |
void |
setBos(BitOut bos)
|
void |
setLastTermWritten(java.lang.String lastTermWritten)
Setter for the last term written. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RunsMerger(RunIteratorFactory _runsSource)
Method Detail |
---|
public int getLastFreq()
public int getLastDocFreq()
public int getNumberOfTerms()
public int getNumberOfPointers()
public boolean isDone()
public long getByteOffset()
public int getBitOffset()
public java.lang.String getLastTermWritten()
public void setLastTermWritten(java.lang.String lastTermWritten)
lastTermWritten
- String with the last term written.public void beginMerge(int size, java.lang.String fileName) throws java.lang.Exception
size
- number of runs to be merged.fileName
- output filename.
java.io.IOException
- if an I/O error occurs.
java.lang.Exception
public void mergeOne(LexiconOutputStream lexStream) throws java.lang.Exception
lexStream
- LexiconOutputStream used to write the lexicon.
java.io.IOException
- if an I/O error occurs.
java.lang.Exception
public void endMerge(LexiconOutputStream lexStream) throws java.io.IOException
lexStream
- LexiconOutputStream used to write the lexicon.
java.io.IOException
- if an I/O error occurs.public BitOut getBos()
public void setBos(BitOut bos)
|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |