Class Lucene99SkipWriter
java.lang.Object
org.apache.lucene.codecs.MultiLevelSkipListWriter
org.apache.lucene.codecs.lucene99.Lucene99SkipWriter
Write skip lists with multiple levels, and support skip within block ints.
Assume that docFreq = 28, skipInterval = blockSize = 12
| block#0 | | block#1 | |vInts| d d d d d d d d d d d d d d d d d d d d d d d d d d d d (posting list) ^ ^ (level 0 skip point)
Note that skipWriter will ignore first document in block#0, since it is useless as a skip point. Also, we'll never skip into the vInts block, only record skip data at the start its start point(if it exist).
For each skip point, we will record: 1. docID in former position, i.e. for position 12, record docID[11], etc. 2. its related file points(position, payload), 3. related numbers or uptos(position, payload). 4. start offset.
-
Field Summary
Fields inherited from class org.apache.lucene.codecs.MultiLevelSkipListWriter
numberOfSkipLevels
-
Constructor Summary
ConstructorDescriptionLucene99SkipWriter
(int maxSkipLevels, int blockSize, int docCount, IndexOutput docOut, IndexOutput posOut, IndexOutput payOut) -
Method Summary
Modifier and TypeMethodDescriptionvoid
bufferSkip
(int doc, CompetitiveImpactAccumulator competitiveFreqNorms, int numDocs, long posFP, long payFP, int posBufferUpto, int payloadByteUpto) Sets the values for the current skip data.void
Creates new buffers or empties the existing onesvoid
setField
(boolean fieldHasPositions, boolean fieldHasOffsets, boolean fieldHasPayloads) static void
protected void
writeSkipData
(int level, DataOutput skipBuffer) Subclasses must implement the actual skip data encoding in this method.Methods inherited from class org.apache.lucene.codecs.MultiLevelSkipListWriter
bufferSkip, init, writeChildPointer, writeLevelLength, writeSkip
-
Constructor Details
-
Lucene99SkipWriter
public Lucene99SkipWriter(int maxSkipLevels, int blockSize, int docCount, IndexOutput docOut, IndexOutput posOut, IndexOutput payOut)
-
-
Method Details
-
setField
public void setField(boolean fieldHasPositions, boolean fieldHasOffsets, boolean fieldHasPayloads) -
resetSkip
public void resetSkip()Description copied from class:MultiLevelSkipListWriter
Creates new buffers or empties the existing ones- Overrides:
resetSkip
in classMultiLevelSkipListWriter
-
bufferSkip
public void bufferSkip(int doc, CompetitiveImpactAccumulator competitiveFreqNorms, int numDocs, long posFP, long payFP, int posBufferUpto, int payloadByteUpto) throws IOException Sets the values for the current skip data.- Throws:
IOException
-
writeSkipData
Description copied from class:MultiLevelSkipListWriter
Subclasses must implement the actual skip data encoding in this method.- Specified by:
writeSkipData
in classMultiLevelSkipListWriter
- Parameters:
level
- the level skip data shall be writing forskipBuffer
- the skip buffer to write to- Throws:
IOException
-
writeImpacts
public static void writeImpacts(CompetitiveImpactAccumulator acc, DataOutput out) throws IOException - Throws:
IOException
-