jpountz commented on a change in pull request #569: LUCENE-8687: Optimise radix 
partitioning for points on heap
URL: https://github.com/apache/lucene-solr/pull/569#discussion_r254985158
 
 

 ##########
 File path: 
lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextBKDWriter.java
 ##########
 @@ -1030,15 +1017,17 @@ private void build(int nodeID, int leafNodeOffset,
       // We can write the block in any order so by default we write it sorted 
by the dimension that has the
       // least number of unique bytes at commonPrefixLengths[dim], which makes 
compression more efficient
 
-      if (data instanceof HeapPointWriter == false) {
+      HeapPointWriter heapSource;
+      if (points.writer instanceof HeapPointWriter == false) {
         // Adversarial cases can cause this, e.g. very lopsided data, all 
equal points, such that we started
         // offline, but then kept splitting only in one dimension, and so 
never had to rewrite into heap writer
-        data = switchToHeap(data);
+        heapSource  = switchToHeap(points.writer);
+      } else {
+        heapSource = (HeapPointWriter) points.writer;
       }
 
-      // We ensured that maxPointsSortInHeap was >= maxPointsInLeafNode, so we 
better be in heap at this point:
-      HeapPointWriter heapSource = (HeapPointWriter) data;
-
+      int from = (int) points.start;
+      int to = (int) (points.start + points.count);
 
 Review comment:
   can you use Math#toIntExact instead?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to