Module org.apache.lucene.codecs
Class SimpleTextSkipWriter
- java.lang.Object
-
- org.apache.lucene.codecs.MultiLevelSkipListWriter
-
- org.apache.lucene.codecs.simpletext.SimpleTextSkipWriter
-
class SimpleTextSkipWriter extends MultiLevelSkipListWriter
plain text skip data.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
BLOCK_SIZE
(package private) static BytesRef
CHILD_POINTER
private CompetitiveImpactAccumulator[]
curCompetitiveFreqNorms
private int
curDoc
private long
curDocFilePointer
(package private) static BytesRef
FREQ
(package private) static BytesRef
IMPACT
(package private) static BytesRef
IMPACTS
(package private) static BytesRef
IMPACTS_END
(package private) static BytesRef
LEVEL
(package private) static BytesRef
LEVEL_LENGTH
(package private) static int
maxSkipLevels
(package private) static BytesRef
NORM
private BytesRefBuilder
scratch
(package private) static BytesRef
SKIP_DOC
(package private) static BytesRef
SKIP_DOC_FP
(package private) static BytesRef
SKIP_LIST
(package private) static int
skipMultiplier
private java.util.Map<java.lang.Integer,java.lang.Boolean>
wroteHeaderPerLevelMap
-
Fields inherited from class org.apache.lucene.codecs.MultiLevelSkipListWriter
numberOfSkipLevels
-
-
Constructor Summary
Constructors Constructor Description SimpleTextSkipWriter(SegmentWriteState writeState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
bufferSkip(int doc, long docFilePointer, int numDocs, CompetitiveImpactAccumulator competitiveImpactAccumulator)
protected void
resetSkip()
Creates new buffers or empties the existing onesprotected void
writeChildPointer(long childPointer, DataOutput skipBuffer)
Writes the child pointer of a block to the given output.protected void
writeLevelLength(long levelLength, IndexOutput output)
Writes the length of a level to the given output.long
writeSkip(IndexOutput output)
Writes the buffered skip lists to the given output.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
-
-
-
-
Field Detail
-
skipMultiplier
static final int skipMultiplier
- See Also:
- Constant Field Values
-
maxSkipLevels
static final int maxSkipLevels
- See Also:
- Constant Field Values
-
BLOCK_SIZE
static final int BLOCK_SIZE
- See Also:
- Constant Field Values
-
wroteHeaderPerLevelMap
private java.util.Map<java.lang.Integer,java.lang.Boolean> wroteHeaderPerLevelMap
-
curDoc
private int curDoc
-
curDocFilePointer
private long curDocFilePointer
-
curCompetitiveFreqNorms
private CompetitiveImpactAccumulator[] curCompetitiveFreqNorms
-
scratch
private final BytesRefBuilder scratch
-
SKIP_LIST
static final BytesRef SKIP_LIST
-
LEVEL_LENGTH
static final BytesRef LEVEL_LENGTH
-
LEVEL
static final BytesRef LEVEL
-
SKIP_DOC
static final BytesRef SKIP_DOC
-
SKIP_DOC_FP
static final BytesRef SKIP_DOC_FP
-
IMPACTS
static final BytesRef IMPACTS
-
IMPACT
static final BytesRef IMPACT
-
FREQ
static final BytesRef FREQ
-
NORM
static final BytesRef NORM
-
IMPACTS_END
static final BytesRef IMPACTS_END
-
CHILD_POINTER
static final BytesRef CHILD_POINTER
-
-
Constructor Detail
-
SimpleTextSkipWriter
SimpleTextSkipWriter(SegmentWriteState writeState) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
writeSkipData
protected void writeSkipData(int level, DataOutput skipBuffer) throws java.io.IOException
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:
java.io.IOException
-
resetSkip
protected void resetSkip()
Description copied from class:MultiLevelSkipListWriter
Creates new buffers or empties the existing ones- Overrides:
resetSkip
in classMultiLevelSkipListWriter
-
writeSkip
public long writeSkip(IndexOutput output) throws java.io.IOException
Description copied from class:MultiLevelSkipListWriter
Writes the buffered skip lists to the given output.- Overrides:
writeSkip
in classMultiLevelSkipListWriter
- Parameters:
output
- the IndexOutput the skip lists shall be written to- Returns:
- the pointer the skip list starts
- Throws:
java.io.IOException
-
bufferSkip
void bufferSkip(int doc, long docFilePointer, int numDocs, CompetitiveImpactAccumulator competitiveImpactAccumulator) throws java.io.IOException
- Throws:
java.io.IOException
-
writeLevelLength
protected void writeLevelLength(long levelLength, IndexOutput output) throws java.io.IOException
Description copied from class:MultiLevelSkipListWriter
Writes the length of a level to the given output.- Overrides:
writeLevelLength
in classMultiLevelSkipListWriter
- Parameters:
levelLength
- the length of a leveloutput
- the IndexOutput the length shall be written to- Throws:
java.io.IOException
-
writeChildPointer
protected void writeChildPointer(long childPointer, DataOutput skipBuffer) throws java.io.IOException
Description copied from class:MultiLevelSkipListWriter
Writes the child pointer of a block to the given output.- Overrides:
writeChildPointer
in classMultiLevelSkipListWriter
- Parameters:
childPointer
- block of higher level point to the lower levelskipBuffer
- the skip buffer to write to- Throws:
java.io.IOException
-
-