public abstract class MultiLevelSkipListReader extends Object implements Closeable
MultiLevelSkipListWriter
for the information about the encoding
of the multi level skip lists.
Subclasses must implement the abstract method readSkipData(int, IndexInput)
which defines the actual format of the skip data.Modifier and Type | Field and Description |
---|---|
protected int |
maxNumberOfSkipLevels
the maximum number of skip levels possible for this index
|
protected int |
numberOfSkipLevels
number of levels in this skip list
|
protected int[] |
skipDoc
Doc id of current skip entry per level.
|
Modifier | Constructor and Description |
---|---|
protected |
MultiLevelSkipListReader(IndexInput skipStream,
int maxSkipLevels,
int skipInterval)
Creates a
MultiLevelSkipListReader , where
skipInterval and skipMultiplier are
the same. |
protected |
MultiLevelSkipListReader(IndexInput skipStream,
int maxSkipLevels,
int skipInterval,
int skipMultiplier)
Creates a
MultiLevelSkipListReader . |
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
getDoc()
Returns the id of the doc to which the last call of
skipTo(int)
has skipped. |
void |
init(long skipPointer,
int df)
Initializes the reader, for reuse on a new term.
|
protected long |
readChildPointer(IndexInput skipStream)
read the child pointer written via
MultiLevelSkipListWriter.writeChildPointer(long,
DataOutput) . |
protected long |
readLevelLength(IndexInput skipStream)
read the length of the current level written via
MultiLevelSkipListWriter.writeLevelLength(long, IndexOutput) . |
protected abstract int |
readSkipData(int level,
IndexInput skipStream)
Subclasses must implement the actual skip data encoding in this method.
|
protected void |
seekChild(int level)
Seeks the skip entry on the given level
|
protected void |
setLastSkipData(int level)
Copies the values of the last read skip entry on this level
|
int |
skipTo(int target)
Skips entries to the first beyond the current whose document number is
greater than or equal to target.
|
protected int maxNumberOfSkipLevels
protected int numberOfSkipLevels
protected int[] skipDoc
protected MultiLevelSkipListReader(IndexInput skipStream, int maxSkipLevels, int skipInterval, int skipMultiplier)
MultiLevelSkipListReader
.protected MultiLevelSkipListReader(IndexInput skipStream, int maxSkipLevels, int skipInterval)
MultiLevelSkipListReader
, where
skipInterval
and skipMultiplier
are
the same.public int getDoc()
skipTo(int)
has skipped.public int skipTo(int target) throws IOException
IOException
protected void seekChild(int level) throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void init(long skipPointer, int df) throws IOException
IOException
protected abstract int readSkipData(int level, IndexInput skipStream) throws IOException
level
- the level skip data shall be read fromskipStream
- the skip stream to read fromIOException
protected long readLevelLength(IndexInput skipStream) throws IOException
MultiLevelSkipListWriter.writeLevelLength(long, IndexOutput)
.skipStream
- the IndexInput the length shall be read fromIOException
protected long readChildPointer(IndexInput skipStream) throws IOException
MultiLevelSkipListWriter.writeChildPointer(long,
DataOutput)
.skipStream
- the IndexInput the child pointer shall be read fromIOException
protected void setLastSkipData(int level)
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.