BKDWriter
Recursively builds a block KD-tree to assign all incoming points in N-dim space to smaller and smaller N-dim rectangles (cells) until the number of points in a given rectangle is <= config.maxPointsInLeafNode. The tree is partially balanced, which means the leaf nodes will have the requested config.maxPointsInLeafNode except one that might have less. Leaf nodes may straddle the two bottom levels of the binary tree. Values that fall exactly on a cell boundary may be in either cell.
The number of dimensions can be 1 to 8, but every byte[] value is fixed length.
This consumes heap during writing: it allocates a Long[numLeaves], a byte[numLeaves*(1+config.bytesPerDim)] and then uses up to the specified maxMBSortInHeap heap space for writing.
NOTE: This can write at most Integer.MAX_VALUE * config.maxPointsInLeafNode * / config.bytesPerDim total points.
Constructors
Properties
Functions
Writes the BKD tree to the provided IndexOutputs and returns a Runnable that writes the index of the tree if at least one point has been added, or null otherwise.
More efficient bulk-add for incoming PointValuess. This does a merge sort of the already sorted values and currently only works when numDims==1. This returns -1 if all documents containing dimensional values were deleted.
Write a field from a MutablePointTree. This way of writing points is faster than regular writes with BKDWriter.add since there is opportunity for reordering points before writing them to disk. This method does not use transient disk in order to reorder points.