|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgate.creole.annic.apache.lucene.index.SegmentMerger
final class SegmentMerger
The SegmentMerger class combines two or more Segments, represented by an IndexReader (add(gate.creole.annic.apache.lucene.index.IndexReader),
into a single Segment. After adding the appropriate readers, call the merge method to combine the
segments.
If the compoundFile flag is set, then the segments will be merged into a compound file.
merge(),
add(gate.creole.annic.apache.lucene.index.IndexReader)| Field Summary | |
|---|---|
private static String[] |
COMPOUND_EXTENSIONS
|
private Directory |
directory
|
private FieldInfos |
fieldInfos
|
private OutputStream |
freqOutput
|
private int |
lastSkipDoc
|
private long |
lastSkipFreqPointer
|
private long |
lastSkipProxPointer
|
private OutputStream |
proxOutput
|
private SegmentMergeQueue |
queue
|
private Vector |
readers
|
private String |
segment
|
private RAMOutputStream |
skipBuffer
|
private int |
skipInterval
|
private TermInfo |
termInfo
|
private TermInfosWriter |
termInfosWriter
|
private boolean |
useCompoundFile
|
private static String[] |
VECTOR_EXTENSIONS
|
| Constructor Summary | |
|---|---|
SegmentMerger(Directory dir,
String name,
boolean compoundFile)
|
|
| Method Summary | |
|---|---|
(package private) void |
add(IndexReader reader)
Add an IndexReader to the collection of readers that are to be merged |
private int |
appendPostings(SegmentMergeInfo[] smis,
int n)
Process postings from multiple segments all positioned on the same term. |
private void |
bufferSkip(int doc)
|
(package private) void |
closeReaders()
close all IndexReaders that have been added. |
private void |
createCompoundFile()
|
(package private) int |
merge()
Merges the readers specified by the add(gate.creole.annic.apache.lucene.index.IndexReader) method into the directory passed to the constructor |
private int |
mergeFields()
|
private void |
mergeNorms()
|
private void |
mergeTermInfo(SegmentMergeInfo[] smis,
int n)
Merge one term found in one or more segments. |
private void |
mergeTermInfos()
|
private void |
mergeTerms()
|
private void |
mergeVectors()
Merge the TermVectors from each of the segments into the new one. |
private void |
resetSkip()
|
(package private) IndexReader |
segmentReader(int i)
|
private long |
writeSkip()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private boolean useCompoundFile
private Directory directory
private String segment
private Vector readers
private FieldInfos fieldInfos
private static final String[] COMPOUND_EXTENSIONS
private static final String[] VECTOR_EXTENSIONS
private OutputStream freqOutput
private OutputStream proxOutput
private TermInfosWriter termInfosWriter
private int skipInterval
private SegmentMergeQueue queue
private final TermInfo termInfo
private RAMOutputStream skipBuffer
private int lastSkipDoc
private long lastSkipFreqPointer
private long lastSkipProxPointer
| Constructor Detail |
|---|
SegmentMerger(Directory dir,
String name,
boolean compoundFile)
dir - The Directory to merge the other segments intoname - The name of the new segmentcompoundFile - true if the new segment should use a compoundFile| Method Detail |
|---|
final void add(IndexReader reader)
reader - final IndexReader segmentReader(int i)
i - The index of the reader to return
final int merge()
throws IOException
add(gate.creole.annic.apache.lucene.index.IndexReader) method into the directory passed to the constructor
IOException
final void closeReaders()
throws IOException
IOException
private final void createCompoundFile()
throws IOException
IOException
private final int mergeFields()
throws IOException
IOException
private final void mergeVectors()
throws IOException
IOException
private final void mergeTerms()
throws IOException
IOException
private final void mergeTermInfos()
throws IOException
IOException
private final void mergeTermInfo(SegmentMergeInfo[] smis,
int n)
throws IOException
smis
contains segments that are positioned at the same term. N
is the number of cells in the array actually occupied.
smis - array of segmentsn - number of cells in the array actually occupied
IOException
private final int appendPostings(SegmentMergeInfo[] smis,
int n)
throws IOException
smis - array of segmentsn - number of cells in the array actually occupied
IOException
private void resetSkip()
throws IOException
IOException
private void bufferSkip(int doc)
throws IOException
IOException
private long writeSkip()
throws IOException
IOException
private void mergeNorms()
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||