Class HeapPointWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, PointWriter

    public final class HeapPointWriter
    extends java.lang.Object
    implements PointWriter
    Utility class to write new points into in-heap arrays.
    • Field Detail

      • block

        public final byte[] block
      • size

        final int size
      • scratch

        private final byte[] scratch
      • nextWrite

        private int nextWrite
      • closed

        private boolean closed
    • Constructor Detail

      • HeapPointWriter

        public HeapPointWriter​(BKDConfig config,
                               int size)
    • Method Detail

      • getPackedValueSlice

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

        public void append​(byte[] packedValue,
                           int docID)
        Description copied from interface: PointWriter
        Add a new point from the packed value and docId
        Specified by:
        append in interface PointWriter
      • swap

        public void swap​(int i,
                         int j)
      • computeCardinality

        public int computeCardinality​(int from,
                                      int to,
                                      int[] commonPrefixLengths)
      • count

        public long count()
        Description copied from interface: PointWriter
        Return the number of points in this writer
        Specified by:
        count in interface PointWriter
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • destroy

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object