iverase commented on code in PR #14393: URL: https://github.com/apache/lucene/pull/14393#discussion_r2010030440
########## 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: We could, I am concerned on the overhead of using it when flushing small segments. Maybe it is not worthy the complexity of specializing for that case and we should use the packed impl all the time. I am ok either way. -- 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