Class SimpleTextSkipReader
- java.lang.Object
-
- org.apache.lucene.codecs.MultiLevelSkipListReader
-
- org.apache.lucene.codecs.simpletext.SimpleTextSkipReader
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
class SimpleTextSkipReader extends MultiLevelSkipListReader
This class reads skip lists with multiple levels.See
SimpleTextFieldsWriter
for the information about the encoding of the multi level skip lists.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
hasSkipList
private Impacts
impacts
private long
nextSkipDocFP
private int
numLevels
private java.util.List<java.util.List<Impact>>
perLevelImpacts
private BytesRefBuilder
scratch
private CharsRefBuilder
scratchUTF16
-
Fields inherited from class org.apache.lucene.codecs.MultiLevelSkipListReader
maxNumberOfSkipLevels, numberOfSkipLevels, skipDoc
-
-
Constructor Summary
Constructors Constructor Description SimpleTextSkipReader(IndexInput skipStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) Impacts
getImpacts()
(package private) int
getNextSkipDoc()
(package private) long
getNextSkipDocFP()
(package private) boolean
hasSkipList()
private void
init()
protected long
readChildPointer(IndexInput skipStream)
read the child pointer written viaMultiLevelSkipListWriter.writeChildPointer(long, DataOutput)
.protected long
readLevelLength(IndexInput skipStream)
read the length of the current level written viaMultiLevelSkipListWriter.writeLevelLength(long, IndexOutput)
.protected int
readSkipData(int level, IndexInput skipStream)
Subclasses must implement the actual skip data encoding in this method.(package private) void
reset(long skipPointer, int docFreq)
int
skipTo(int target)
Skips entries to the first beyond the current whose document number is greater than or equal to target.-
Methods inherited from class org.apache.lucene.codecs.MultiLevelSkipListReader
close, getDoc, init, seekChild, setLastSkipData
-
-
-
-
Field Detail
-
scratchUTF16
private final CharsRefBuilder scratchUTF16
-
scratch
private final BytesRefBuilder scratch
-
impacts
private Impacts impacts
-
perLevelImpacts
private java.util.List<java.util.List<Impact>> perLevelImpacts
-
nextSkipDocFP
private long nextSkipDocFP
-
numLevels
private int numLevels
-
hasSkipList
private boolean hasSkipList
-
-
Constructor Detail
-
SimpleTextSkipReader
SimpleTextSkipReader(IndexInput skipStream)
-
-
Method Detail
-
skipTo
public int skipTo(int target) throws java.io.IOException
Description copied from class:MultiLevelSkipListReader
Skips entries to the first beyond the current whose document number is greater than or equal to target. Returns the current doc count.- Overrides:
skipTo
in classMultiLevelSkipListReader
- Throws:
java.io.IOException
-
readSkipData
protected int readSkipData(int level, IndexInput skipStream) throws java.io.IOException
Description copied from class:MultiLevelSkipListReader
Subclasses must implement the actual skip data encoding in this method.- Specified by:
readSkipData
in classMultiLevelSkipListReader
- Parameters:
level
- the level skip data shall be read fromskipStream
- the skip stream to read from- Throws:
java.io.IOException
-
readLevelLength
protected long readLevelLength(IndexInput skipStream) throws java.io.IOException
Description copied from class:MultiLevelSkipListReader
read the length of the current level written viaMultiLevelSkipListWriter.writeLevelLength(long, IndexOutput)
.- Overrides:
readLevelLength
in classMultiLevelSkipListReader
- Parameters:
skipStream
- the IndexInput the length shall be read from- Returns:
- level length
- Throws:
java.io.IOException
-
readChildPointer
protected long readChildPointer(IndexInput skipStream) throws java.io.IOException
Description copied from class:MultiLevelSkipListReader
read the child pointer written viaMultiLevelSkipListWriter.writeChildPointer(long, DataOutput)
.- Overrides:
readChildPointer
in classMultiLevelSkipListReader
- Parameters:
skipStream
- the IndexInput the child pointer shall be read from- Returns:
- child pointer
- Throws:
java.io.IOException
-
reset
void reset(long skipPointer, int docFreq) throws java.io.IOException
- Throws:
java.io.IOException
-
init
private void init()
-
getImpacts
Impacts getImpacts()
-
getNextSkipDocFP
long getNextSkipDocFP()
-
getNextSkipDoc
int getNextSkipDoc()
-
hasSkipList
boolean hasSkipList()
-
-