org.apache.lucene.util.bkd

## Class HeapPointWriter

- java.lang.Object
- - org.apache.lucene.util.bkd.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 Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `List<byte[]>` | `blocks`
    `int[]` | `docIDs`
    `int[]` | `ords`
    `long[]` | `ordsLong`
    `int` | `valuesPerBlock`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HeapPointWriter(int initSize, int maxSize, int packedBytesLength, boolean longOrds, boolean singleValuePerDoc)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `append(byte[] packedValue, long ord, int docID)` Add a new point
    `void` | `close()`
    `void` | `copyFrom(HeapPointWriter other)`
    `void` | `destroy()` Removes any temp files behind this writer
    `void` | `getPackedValueSlice(int index, BytesRef result)` Returns a reference, in `result`, to the byte[] slice holding this value
    `PointReader` | `getReader(long start, long length)` Returns a `PointReader` iterator to step through all previously added points
    `PointReader` | `getSharedReader(long start, long length, List<Closeable> toCloseHeroically)` Returns the single shared reader, used at multiple times during the recursion, to read previously added points
    `void` | `readPackedValue(int index, byte[] bytes)`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### 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

    - #### copyFrom

          public void copyFrom(HeapPointWriter other)

    - #### 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`

    - #### getReader

          public PointReader getReader(long start,
                                       long length)

      Description copied from interface: `PointWriter`
      Returns a `PointReader` iterator to step through all previously added points
      Specified by:
        `getReader` 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`

    - #### close

          public void close()

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`

    - #### destroy

          public void destroy()

      Description copied from interface: `PointWriter`
      Removes any temp files behind this writer
      Specified by:
        `destroy` in interface `PointWriter`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.