iverase commented on a change in pull request #607:
URL: https://github.com/apache/lucene/pull/607#discussion_r786980842
##########
File path: lucene/core/src/java/org/apache/lucene/util/bkd/BKDReader.java
##########
@@ -105,6 +107,46 @@ public BKDReader(IndexInput metaIn, IndexInput indexIn,
IndexInput dataIn) throw
}
this.packedIndex = indexIn.slice("packedIndex", indexStartPointer,
numIndexBytes);
this.in = dataIn;
+ this.isTreeBalanced = isTreeBalanced();
+ }
+
+ private boolean isTreeBalanced() throws IOException {
+ if (version >= BKDWriter.VERSION_META_FILE) {
+ // Since lucene 8.6 all trees are unbalanced.
+ return false;
+ }
+ if (config.numDims > 1) {
+ // High dimensional tree in pre-8.6 indices are balanced.
+ return true;
+ }
+ // count of the last node for unbalanced trees
+ final int lastLeafNodePointCount = Math.toIntExact(pointCount %
config.maxPointsInLeafNode);
Review comment:
done in 3490046
--
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]