You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/12/13 05:46:12 UTC

[GitHub] [lucene] sonatype-lift[bot] commented on a change in pull request #536: Don't store graph offsets for HNSW graph

sonatype-lift[bot] commented on a change in pull request #536:
URL: https://github.com/apache/lucene/pull/536#discussion_r767427109



##########
File path: lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90HnswVectorsReader.java
##########
@@ -516,23 +494,20 @@ private void readValue(int targetOrd) throws IOException {
     IndexedKnnGraphReader(FieldEntry entry, IndexInput dataIn) {
       this.dataIn = dataIn;
       this.nodesByLevel = entry.nodesByLevel;
-      this.ordOffsetsByLevel = entry.ordOffsetsByLevel;
       this.numLevels = entry.numLevels;
-      this.entryNode = numLevels == 1 ? 0 : nodesByLevel[numLevels - 1][0];
+      this.entryNode = numLevels > 1 ? nodesByLevel[numLevels - 1][0] : 0;
       this.size = entry.size();
+      this.graphOffsetsByLevel = entry.graphOffsetsByLevel;
+      this.bytesForConns = (entry.maxConn + 1) * 4;

Review comment:
       *IntLongMath:*  Expression of type int may overflow before being assigned to a long [(details)](https://errorprone.info/bugpattern/IntLongMath)
   (at-me [in a reply](https://help.sonatype.com/lift/talking-to-lift) with `help` or `ignore`)




-- 
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-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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