Package org.apache.lucene.util.bkd
Class BKDRadixSelector
java.lang.Object
org.apache.lucene.util.bkd.BKDRadixSelector
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 ClassesModifier and TypeClassDescriptionstatic final recordSliced reference to points in an PointWriter. -
Constructor Summary
ConstructorsConstructorDescriptionBKDRadixSelector(BKDConfig config, int maxPointsSortInHeap, Directory tempDir, String tempFileNamePrefix) Sole constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidheapRadixSort(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 providedpointsfrom the givenfromto the giventoto populate thepartitionSlicesarray holder (length > 1) with two path slices so the path slice at position 0 containspartition - frompoints where the value of thedimis lower or equal to theto -frompoints on the slice at position 1.
-
Constructor Details
-
Method Details
-
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 providedpointsfrom the givenfromto the giventoto populate thepartitionSlicesarray holder (length > 1) with two path slices so the path slice at position 0 containspartition - frompoints where the value of thedimis lower or equal to theto -frompoints on the slice at position 1.The
dimCommonPrefixprovides a hint for the length of the common prefix length for thedimwhere are partitioning the points.It return the value of the
dimat the partition point.If the provided
pointsis wrapping anOfflinePointWriter, 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
-