Class Lucene99SkipWriter
- java.lang.Object
-
- org.apache.lucene.codecs.MultiLevelSkipListWriter
-
- org.apache.lucene.codecs.lucene99.Lucene99SkipWriter
-
public final class Lucene99SkipWriter extends MultiLevelSkipListWriter
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
Constructors Constructor Description Lucene99SkipWriter(int maxSkipLevels, int blockSize, int docCount, IndexOutput docOut, IndexOutput posOut, IndexOutput payOut)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbufferSkip(int doc, CompetitiveImpactAccumulator competitiveFreqNorms, int numDocs, long posFP, long payFP, int posBufferUpto, int payloadByteUpto)Sets the values for the current skip data.voidresetSkip()Creates new buffers or empties the existing onesvoidsetField(boolean fieldHasPositions, boolean fieldHasOffsets, boolean fieldHasPayloads)static voidwriteImpacts(CompetitiveImpactAccumulator acc, DataOutput out)protected voidwriteSkipData(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 Detail
-
Lucene99SkipWriter
public Lucene99SkipWriter(int maxSkipLevels, int blockSize, int docCount, IndexOutput docOut, IndexOutput posOut, IndexOutput payOut)
-
-
Method Detail
-
setField
public void setField(boolean fieldHasPositions, boolean fieldHasOffsets, boolean fieldHasPayloads)
-
resetSkip
public void resetSkip()
Description copied from class:MultiLevelSkipListWriterCreates new buffers or empties the existing ones- Overrides:
resetSkipin classMultiLevelSkipListWriter
-
bufferSkip
public void bufferSkip(int doc, CompetitiveImpactAccumulator competitiveFreqNorms, int numDocs, long posFP, long payFP, int posBufferUpto, int payloadByteUpto) throws IOExceptionSets the values for the current skip data.- Throws:
IOException
-
writeSkipData
protected void writeSkipData(int level, DataOutput skipBuffer) throws IOExceptionDescription copied from class:MultiLevelSkipListWriterSubclasses must implement the actual skip data encoding in this method.- Specified by:
writeSkipDatain 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
-
-