Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class BlockPackedWriter

    A writer for large sequences of longs.

    The sequence is divided into fixed-size blocks and for each block, the difference between each value and the minimum value of the block is encoded using as few bits as possible. Memory usage of this class is proportional to the block size. Each block has an overhead between 1 and 10 bytes to store the minimum value and the number of bits per value of the block.

    Format:
    • <BLock>BlockCount
    • BlockCount: ⌈ ValueCount / BlockSize ⌉
    • Block: <Header, (Ints)>
    • Header: <Token, (MinValue)>
    • Token: a byte (WriteByte(byte)), first 7 bits are the number of bits per value (bitsPerValue). If the 8th bit is 1, then MinValue (see next) is 0, otherwise MinValue and needs to be decoded
    • MinValue: a zigzag-encoded variable-length long (WriteVInt64(long)) whose value should be added to every int from the block to restore the original values
    • Ints: If the number of bits per value is 0, then there is nothing to decode and all ints are equal to MinValue. Otherwise: BlockSize packed ints (PackedInt32s) encoded on exactly bitsPerValue bits per value. They are the subtraction of the original values and MinValue

    Note

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

    Inheritance
    object
    AbstractBlockPackedWriter
    BlockPackedWriter
    Inherited Members
    AbstractBlockPackedWriter.Reset(DataOutput)
    AbstractBlockPackedWriter.Add(long)
    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 BlockPackedWriter : AbstractBlockPackedWriter

    Constructors

    BlockPackedWriter(DataOutput, int)

    Sole constructor.

    Declaration
    public BlockPackedWriter(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
    BlockPackedReaderIterator
    BlockPackedReader

    Methods

    Flush()

    A writer for large sequences of longs.

    The sequence is divided into fixed-size blocks and for each block, the difference between each value and the minimum value of the block is encoded using as few bits as possible. Memory usage of this class is proportional to the block size. Each block has an overhead between 1 and 10 bytes to store the minimum value and the number of bits per value of the block.

    Format:
    • <BLock>BlockCount
    • BlockCount: ⌈ ValueCount / BlockSize ⌉
    • Block: <Header, (Ints)>
    • Header: <Token, (MinValue)>
    • Token: a byte (WriteByte(byte)), first 7 bits are the number of bits per value (bitsPerValue). If the 8th bit is 1, then MinValue (see next) is 0, otherwise MinValue and needs to be decoded
    • MinValue: a zigzag-encoded variable-length long (WriteVInt64(long)) whose value should be added to every int from the block to restore the original values
    • Ints: If the number of bits per value is 0, then there is nothing to decode and all ints are equal to MinValue. Otherwise: BlockSize packed ints (PackedInt32s) encoded on exactly bitsPerValue bits per value. They are the subtraction of the original values and MinValue

    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
    BlockPackedReaderIterator
    BlockPackedReader

    See Also

    BlockPackedReaderIterator
    BlockPackedReader
    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.