Class AppendingDeltaPackedLongBuffer


  • public final class AppendingDeltaPackedLongBuffer
    extends LongValues
    Utility class to buffer a list of signed longs in memory. This class only supports appending and is optimized for the case where values are close to each other.
    • Constructor Detail

      • AppendingDeltaPackedLongBuffer

        public AppendingDeltaPackedLongBuffer​(int initialPageCount,
                                              int pageSize,
                                              float acceptableOverheadRatio)
        Parameters:
        initialPageCount - the initial number of pages
        pageSize - the size of a single page
        acceptableOverheadRatio - an acceptable overhead ratio per value
      • AppendingDeltaPackedLongBuffer

        public AppendingDeltaPackedLongBuffer​(float acceptableOverheadRatio)
        Create an AppendingDeltaPackedLongBuffer with initialPageCount=16, pageSize=1024
    • Method Detail

      • ramBytesUsed

        public long ramBytesUsed()
        Return the number of bytes used by this instance.
      • size

        public final long size()
        Get the number of values that have been added to the buffer.
      • add

        public final void add​(long l)
        Append a value to this buffer.
      • get

        public final long get​(long index)
        Description copied from class: LongValues
        Get value at index.
        Specified by:
        get in class LongValues
      • get

        public final int get​(long index,
                             long[] arr,
                             int off,
                             int len)
        Bulk get: read at least one and at most len longs starting from index into arr[off:off+len] and return the actual number of values that have been read.
      • iterator

        public org.apache.lucene.util.packed.AbstractAppendingLongBuffer.Iterator iterator()
        Return an iterator over the values of this buffer.
      • freeze

        public void freeze()
        Pack all pending values in this buffer. Subsequent calls to add(long) will fail.