You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by GitBox <gi...@apache.org> on 2019/07/04 06:46:56 UTC

[GitHub] [lucene-solr] jpountz commented on a change in pull request #747: LUCENE-8888: Improve distribution of points with data dimension in BKD tree leaves

jpountz commented on a change in pull request #747: LUCENE-8888: Improve distribution of points with data dimension in BKD tree leaves
URL: https://github.com/apache/lucene-solr/pull/747#discussion_r300244789
 
 

 ##########
 File path: lucene/core/src/java/org/apache/lucene/util/bkd/BKDRadixSelector.java
 ##########
 @@ -324,23 +337,22 @@ protected int byteAt(int i, int k) {
         assert k >= 0 : "negative prefix " + k;
         if (k  < dimCmpBytes) {
           // dim bytes
-          return points.block[i * packedBytesLength + offset + k] & 0xff;
+          return points.block[i * packedBytesDocIDLength + dimOffset + k] & 0xff;
         } else {
-          // doc id
-          int s = 3 - (k - dimCmpBytes);
-          return (points.docIDs[i] >>> (s * 8)) & 0xff;
+          // data bytes
+          return points.block[i * packedBytesDocIDLength + dataOffset + k] & 0xff;
         }
       }
 
       @Override
       protected Selector getFallbackSelector(int d) {
-        int skypedBytes = d + commonPrefix;
-        final int start = dim * bytesPerDim + skypedBytes;
-        final int end =  dim * bytesPerDim + bytesPerDim;
+        final int skypedBytes = d + commonPrefixLength;
+        final int dimStart = dim * bytesPerDim + skypedBytes;
+        final int dimEnd =  dim * bytesPerDim + bytesPerDim;
+        final int dataOffset = numIndexDims * bytesPerDim;
+        final int dataLength = (numDataDims - numIndexDims) * bytesPerDim + Integer.BYTES;
 
 Review comment:
   I'm assuming the Integer.BYTES is about the doc ID, maybe add a comment to clarify since the variable name doesn't imply that this includes the doc ID?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org