uschindler commented on code in PR #13296:
URL: https://github.com/apache/lucene/pull/13296#discussion_r1565551378


##########
lucene/MIGRATE.md:
##########
@@ -180,6 +180,8 @@ access the members using method calls instead of field 
accesses. Affected classe
 
 - `IOContext`, `MergeInfo`, and `FlushInfo` (GITHUB#13205)
 - `BooleanClause` (GITHUB#13261)
+- `FieldEntry`, a static nested class, from `Lucene90HnswVectorsReader`, 
`SimpleTextKnnVectorsReader`,
+  `Lucene99FlatVectorsReader`, `Lucene99HnswVectorsReader`, and 
`Lucene99ScalarQuantizedVectorsReader`

Review Comment:
   You can remove this as it is internal classes.



##########
lucene/core/src/java/org/apache/lucene/codecs/lucene99/Lucene99FlatVectorsReader.java:
##########
@@ -302,29 +302,50 @@ public void close() throws IOException {
     IOUtils.close(vectorData);
   }
 
-  private static class FieldEntry implements Accountable {
+  private record FieldEntry(
+      VectorSimilarityFunction similarityFunction,
+      VectorEncoding vectorEncoding,
+      long vectorDataOffset,
+      long vectorDataLength,
+      int dimension,
+      int size,
+      OrdToDocDISIReaderConfiguration ordToDoc)
+      implements Accountable {
     private static final long SHALLOW_SIZE =
         RamUsageEstimator.shallowSizeOfInstance(FieldEntry.class);
-    final VectorSimilarityFunction similarityFunction;
-    final VectorEncoding vectorEncoding;
-    final int dimension;
-    final long vectorDataOffset;
-    final long vectorDataLength;
-    final int size;
-    final OrdToDocDISIReaderConfiguration ordToDoc;
 
-    FieldEntry(
+    private FieldEntry(
+        VectorSimilarityFunction similarityFunction,
+        VectorEncoding vectorEncoding,
+        long vectorDataOffset,
+        long vectorDataLength,
+        int dimension,
+        int size,
+        IndexInput input)
+        throws IOException {
+      this(
+          similarityFunction,
+          vectorEncoding,
+          vectorDataOffset,
+          vectorDataLength,
+          dimension,
+          size,
+          OrdToDocDISIReaderConfiguration.fromStoredMeta(input, size));
+    }
+
+    public FieldEntry(

Review Comment:
   does not matter as record is private, but the "public" here could be removed.
   
   Previously this class only had one ctor, so please merge both.



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