jpountz commented on code in PR #14393:
URL: https://github.com/apache/lucene/pull/14393#discussion_r2010037158
##########
lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java:
##########
@@ -596,9 +606,12 @@ private IORunnable writeField1Dim(
MutablePointTree reader)
throws IOException {
MutablePointTreeReaderUtils.sort(config, maxDoc, reader, 0,
Math.toIntExact(reader.size()));
-
+ final int numLeaves =
+ Math.toIntExact(
+ (reader.size() + config.maxPointsInLeafNode() - 1) /
config.maxPointsInLeafNode());
+ checkMaxLeafNodeCount(numLeaves);
final OneDimensionBKDWriter oneDimWriter =
- new OneDimensionBKDWriter(metaOut, indexOut, dataOut);
+ new OneDimensionBKDWriter(metaOut, indexOut, dataOut, new
ArrayLongAccumulator(numLeaves));
Review Comment:
Intuitively, there is ~512x (the leaf node size) more data than file
pointers, so the bottleneck of flushing/merging should be on the data rather
than on file pointers. So having small overhead on file pointers should be ok
(hopefully benchmarks will confirm this).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]