Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class MonotonicBlockPackedWriter

    A writer for large monotonically increasing sequences of positive longs.

    The sequence is divided into fixed-size blocks and for each block, values are modeled after a linear function f: x → A × x + B. The block encodes deltas from the expected values computed from this function using as few bits as possible. Each block has an overhead between 6 and 14 bytes.

    Format:
    • <BLock>BlockCount
    • BlockCount: ⌈ ValueCount / BlockSize ⌉
    • Block: <Header, (Ints)>
    • Header: <B, A, BitsPerValue>
    • B: the B from f: x → A × x + B using a variable-length long (WriteVInt64(long))
    • A: the A from f: x → A × x + B encoded using SingleToInt32Bits(float) on 4 bytes (WriteVInt32(int))
    • BitsPerValue: a variable-length int (WriteVInt32(int))
    • Ints: if BitsPerValue is 0, then there is nothing to read and all values perfectly match the result of the function. Otherwise, these are the zigzag-encoded packed (PackedInt32s) deltas from the expected value (computed from the function) using exaclty BitsPerValue bits per value

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Inheritance
    object
    AbstractBlockPackedWriter
    MonotonicBlockPackedWriter
    Inherited Members
    AbstractBlockPackedWriter.Reset(DataOutput)
    AbstractBlockPackedWriter.Finish()
    AbstractBlockPackedWriter.Ord
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Util.Packed
    Assembly: Lucene.Net.dll
    Syntax
    public sealed class MonotonicBlockPackedWriter : AbstractBlockPackedWriter

    Constructors

    MonotonicBlockPackedWriter(DataOutput, int)

    Sole constructor.

    Declaration
    public MonotonicBlockPackedWriter(DataOutput @out, int blockSize)
    Parameters
    Type Name Description
    DataOutput out
    int blockSize

    The number of values of a single block, must be a power of 2.

    See Also
    MonotonicBlockPackedReader

    Methods

    Add(long)

    Append a new long.

    Declaration
    public override void Add(long l)
    Parameters
    Type Name Description
    long l
    Overrides
    AbstractBlockPackedWriter.Add(long)
    See Also
    MonotonicBlockPackedReader

    Flush()

    A writer for large monotonically increasing sequences of positive longs.

    The sequence is divided into fixed-size blocks and for each block, values are modeled after a linear function f: x → A × x + B. The block encodes deltas from the expected values computed from this function using as few bits as possible. Each block has an overhead between 6 and 14 bytes.

    Format:
    • <BLock>BlockCount
    • BlockCount: ⌈ ValueCount / BlockSize ⌉
    • Block: <Header, (Ints)>
    • Header: <B, A, BitsPerValue>
    • B: the B from f: x → A × x + B using a variable-length long (WriteVInt64(long))
    • A: the A from f: x → A × x + B encoded using SingleToInt32Bits(float) on 4 bytes (WriteVInt32(int))
    • BitsPerValue: a variable-length int (WriteVInt32(int))
    • Ints: if BitsPerValue is 0, then there is nothing to read and all values perfectly match the result of the function. Otherwise, these are the zigzag-encoded packed (PackedInt32s) deltas from the expected value (computed from the function) using exaclty BitsPerValue bits per value

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    protected override void Flush()
    Overrides
    AbstractBlockPackedWriter.Flush()
    See Also
    MonotonicBlockPackedReader

    See Also

    MonotonicBlockPackedReader
    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.