org.apache.lucene.util.bkd

## Class BKDRadixSelector

- java.lang.Object
- - org.apache.lucene.util.bkd.BKDRadixSelector

-     public final class BKDRadixSelector
      extends Object

  Offline Radix selector for BKD tree.
  NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `BKDRadixSelector.PathSlice` Sliced reference to points in an PointWriter.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BKDRadixSelector(int numDataDims, int numIndexDims, int bytesPerDim, int maxPointsSortInHeap, Directory tempDir, String tempFileNamePrefix)` Sole constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `heapRadixSort(HeapPointWriter points, int from, int to, int dim, int commonPrefixLength)` Sort the heap writer by the specified dim.
    `byte[]` | `select(BKDRadixSelector.PathSlice points, BKDRadixSelector.PathSlice[] partitionSlices, long from, long to, long partitionPoint, int dim, int dimCommonPrefix)` It uses the provided `points` from the given `from` to the given `to` to populate the `partitionSlices` array holder (length > 1) with two path slices so the path slice at position 0 contains `partition - from` points where the value of the `dim` is lower or equal to the `to -from` points on the slice at position 1.

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

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

- - ### Constructor Detail

    - #### BKDRadixSelector

          public BKDRadixSelector(int numDataDims,
                                  int numIndexDims,
                                  int bytesPerDim,
                                  int maxPointsSortInHeap,
                                  Directory tempDir,
                                  String tempFileNamePrefix)

      Sole constructor.

  - ### Method Detail

    - #### select

          public byte[] select(BKDRadixSelector.PathSlice points,
                               BKDRadixSelector.PathSlice[] partitionSlices,
                               long from,
                               long to,
                               long partitionPoint,
                               int dim,
                               int dimCommonPrefix)
                        throws IOException

      It uses the provided `points` from the given `from` to the given `to` to populate the `partitionSlices` array holder (length > 1) with two path slices so the path slice at position 0 contains `partition - from` points where the value of the `dim` is lower or equal to the `to -from` points on the slice at position 1. The `dimCommonPrefix` provides a hint for the length of the common prefix length for the `dim` where are partitioning the points. It return the value of the `dim` at the partition point. If the provided `points` is wrapping an `OfflinePointWriter`, the writer is destroyed in the process to save disk space.
      Throws:
        `IOException`

    - #### heapRadixSort

          public void heapRadixSort(HeapPointWriter points,
                                    int from,
                                    int to,
                                    int dim,
                                    int commonPrefixLength)

      Sort the heap writer by the specified dim. It is used to sort the leaves of the tree

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