iverase commented on a change in pull request #607:
URL: https://github.com/apache/lucene/pull/607#discussion_r787379481



##########
File path: lucene/core/src/java/org/apache/lucene/util/bkd/BKDReader.java
##########
@@ -105,6 +107,51 @@ 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 || numLeaves == 1) {
+      // since lucene 8.6 all trees are unbalanced.
+      // for only one leaf we can assume unbalanced.
+      return false;
+    }

Review comment:
       This is what we are trying to solve here. 
   
   For indices created in Lucene 8.6+, they will always be unbalanced as we 
removed the code to build balanced trees. For one leaf, the layout for balanced 
and unbalanced is the same so we treat them as unbalanced. What am I missing?




-- 
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]

Reply via email to