Class PagedMutable


  • public final class PagedMutable
    extends LongValues
    A PagedMutable. This class slices data into fixed-size blocks which have the same number of bits per value. It can be a useful replacement for PackedInts.Mutable to store more than 2B values.
    • Constructor Detail

      • PagedMutable

        public PagedMutable​(long size,
                            int pageSize,
                            int bitsPerValue,
                            float acceptableOverheadRatio)
        Create a new PagedMutable instance.
        Parameters:
        size - the number of values to store.
        pageSize - the number of values per page
        bitsPerValue - the number of bits per value
        acceptableOverheadRatio - an acceptable overhead ratio
    • Method Detail

      • newMutable

        protected PackedInts.Mutable newMutable​(int valueCount,
                                                int bitsPerValue)
      • newUnfilledCopy

        protected PagedMutable newUnfilledCopy​(long newSize)
      • baseRamBytesUsed

        protected long baseRamBytesUsed()
      • fillPages

        protected final void fillPages()
      • size

        public final long size()
        The number of values.
      • get

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

        public final void set​(long index,
                              long value)
        Set value at index.
      • ramBytesUsed

        public long ramBytesUsed()
        Return the number of bytes used by this object.
      • resize

        public final T resize​(long newSize)
        Create a new copy of size newSize based on the content of this buffer. This method is much more efficient than creating a new instance and copying values one by one.