Class HeapPointWriter

  • All Implemented Interfaces:
    Closeable, AutoCloseable, PointWriter

    public final class HeapPointWriter
    extends Object
    implements PointWriter
    Utility class to write new points into in-heap arrays.
    NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
    • Field Detail

      • docIDs

        public int[] docIDs
      • ordsLong

        public long[] ordsLong
      • ords

        public int[] ords
      • valuesPerBlock

        public final int valuesPerBlock
      • blocks

        public final List<byte[]> blocks
    • Constructor Detail

      • HeapPointWriter

        public HeapPointWriter​(int initSize,
                               int maxSize,
                               int packedBytesLength,
                               boolean longOrds,
                               boolean singleValuePerDoc)
    • Method Detail

      • readPackedValue

        public void readPackedValue​(int index,
                                    byte[] bytes)
      • getPackedValueSlice

        public void getPackedValueSlice​(int index,
                                        BytesRef result)
        Returns a reference, in result, to the byte[] slice holding this value
      • append

        public void append​(byte[] packedValue,
                           long ord,
                           int docID)
        Description copied from interface: PointWriter
        Add a new point
        Specified by:
        append in interface PointWriter
      • getSharedReader

        public PointReader getSharedReader​(long start,
                                           long length,
                                           List<Closeable> toCloseHeroically)
        Description copied from interface: PointWriter
        Returns the single shared reader, used at multiple times during the recursion, to read previously added points
        Specified by:
        getSharedReader in interface PointWriter
      • destroy

        public void destroy()
        Description copied from interface: PointWriter
        Removes any temp files behind this writer
        Specified by:
        destroy in interface PointWriter