iverase commented on code in PR #14393: URL: https://github.com/apache/lucene/pull/14393#discussion_r2010066670
########## 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: Right, let's use it all the time for OneDimensionBKDWriter, it clearly simplifies the implementation -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org