mayya-sharipova commented on a change in pull request #416:
URL: https://github.com/apache/lucene/pull/416#discussion_r751671158



##########
File path: 
lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90HnswVectorsReader.java
##########
@@ -205,6 +215,43 @@ private FieldEntry readField(DataInput input) throws 
IOException {
     return new FieldEntry(input, similarityFunction);
   }
 
+  private void fillGraphNodesAndOffsetsByLevel() throws IOException {
+    for (FieldEntry entry : fields.values()) {
+      IndexInput input =

Review comment:
       Yes, indeed we populate `FieldEntry` from the graph index (levels) file. 
   
   > It feels a bit surprising that FieldEntry is constructed across two 
different files
   
   Indeed, I was not happy with this as well. Alternatively, we can put all 
this information about levels and layers into a single meta file as it is 
currently done.  Happy to hear other suggestions as well.
   
   > It also means FieldEntry isn't immutable
   
   No, `FieldEntry` is immutable, as all its fields are final, they are 
initialized and filled in the `Lucene90HnswVectorsReader`  constructor. 
   
   In  https://github.com/apache/lucene/pull/315 was trying to fill graph data 
lazily on the first use, but it looks like we don't like lazy loading.
   
   
   > Maybe we could keep the file as-is but create a new class to hold the 
graph index, something like GraphLevels?
   
   Is `GraphLevels` instead of `FieldEntry`?  I like the approach of a single 
`FieldEntry` for every field, as it follows how other field types are organized.




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

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



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

Reply via email to