Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class MultiLevelSkipListWriter

    This abstract class writes skip lists with multiple levels.

    Example for skipInterval = 3:
                                                        c            (skip level 2)
                    c                 c                 c            (skip level 1)
        x     x     x     x     x     x     x     x     x     x      (skip level 0)
    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 d d d d  (posting list)
        3     6     9     12    15    18    21    24    27    30     (df)
    
    d - document
    x - skip data
    c - skip data with child pointer
    
    Skip level i contains every skipInterval-th entry from skip level i-1.
    Therefore the number of entries on level i is: floor(df / ((skipInterval ^ (i + 1))).
    
    Each skip entry on a level i>0 contains a pointer to the corresponding skip entry in list i-1.
    this guarantees a logarithmic amount of skips to find the target document.
    
    While this class takes care of writing the different skip levels,
    subclasses must define the actual format of the skip data.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Inheritance
    object
    MultiLevelSkipListWriter
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Codecs
    Assembly: Lucene.Net.dll
    Syntax
    public abstract class MultiLevelSkipListWriter

    Constructors

    MultiLevelSkipListWriter(int, int, int)

    Creates a MultiLevelSkipListWriter, where skipInterval and skipMultiplier are the same.

    Declaration
    protected MultiLevelSkipListWriter(int skipInterval, int maxSkipLevels, int df)
    Parameters
    Type Name Description
    int skipInterval
    int maxSkipLevels
    int df

    MultiLevelSkipListWriter(int, int, int, int)

    Creates a MultiLevelSkipListWriter.

    Declaration
    protected MultiLevelSkipListWriter(int skipInterval, int skipMultiplier, int maxSkipLevels, int df)
    Parameters
    Type Name Description
    int skipInterval
    int skipMultiplier
    int maxSkipLevels
    int df

    Fields

    m_numberOfSkipLevels

    Number of levels in this skip list.

    Declaration
    protected int m_numberOfSkipLevels
    Field Value
    Type Description
    int

    Methods

    BufferSkip(int)

    Writes the current skip data to the buffers. The current document frequency determines the max level is skip data is to be written to.

    Declaration
    public virtual void BufferSkip(int df)
    Parameters
    Type Name Description
    int df

    The current document frequency.

    Exceptions
    Type Condition
    IOException

    If an I/O error occurs.

    Init()

    Allocates internal skip buffers.

    Declaration
    protected virtual void Init()

    ResetSkip()

    Creates new buffers or empties the existing ones.

    Declaration
    public virtual void ResetSkip()

    WriteSkip(IndexOutput)

    Writes the buffered skip lists to the given output.

    Declaration
    public virtual long WriteSkip(IndexOutput output)
    Parameters
    Type Name Description
    IndexOutput output

    The IndexOutput the skip lists shall be written to.

    Returns
    Type Description
    long

    The pointer the skip list starts.

    WriteSkipData(int, IndexOutput)

    Subclasses must implement the actual skip data encoding in this method.

    Declaration
    protected abstract void WriteSkipData(int level, IndexOutput skipBuffer)
    Parameters
    Type Name Description
    int level

    The level skip data shall be writing for.

    IndexOutput skipBuffer

    The skip buffer to write to.

    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.