kaivalnp commented on code in PR #15553:
URL: https://github.com/apache/lucene/pull/15553#discussion_r2722500032
##########
lucene/core/src/java/org/apache/lucene/codecs/KnnVectorsWriter.java:
##########
@@ -401,7 +401,7 @@ static class MergedByteVectorValues extends
ByteVectorValues {
private int docId = -1;
ByteVectorValuesSub current;
- private MergedByteVectorValues(List<ByteVectorValuesSub> subs,
MergeState mergeState)
+ MergedByteVectorValues(List<ByteVectorValuesSub> subs, MergeState
mergeState)
Review Comment:
Can you add a comment specifying that this is package-private for testing?
##########
lucene/core/src/java/org/apache/lucene/codecs/KnnVectorsWriter.java:
##########
@@ -135,7 +135,7 @@ public int index() {
}
}
- private static class ByteVectorValuesSub extends DocIDMerger.Sub {
+ static class ByteVectorValuesSub extends DocIDMerger.Sub {
Review Comment:
Can we add some Javadocs with the `@lucene.internal` tag to avoid users from
depending on this class, now that its more accessible?
##########
lucene/core/src/test/org/apache/lucene/codecs/TestMergedByteVectorValues.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.codecs;
+
+import java.io.IOException;
+import java.util.List;
+import org.apache.lucene.index.ByteVectorValues;
+import org.apache.lucene.index.MergeState;
+import org.apache.lucene.tests.util.LuceneTestCase;
+
+/** Tests for MergedByteVectorValues to ensure lastOrd is properly incremented
during iteration. */
+public class TestMergedByteVectorValues extends LuceneTestCase {
+
+ /**
+ * Test that skipping vectors in MergedByteVectorValues via nextDoc() and
then loading a
+ * subsequent vector via vectorValue() works correctly.
+ */
+ public void testSkipsInMergedByteVectorValues() throws IOException {
Review Comment:
Should we include an equivalent test for the float vector values? (making
the class more generic like `TestMergedVectorValues`)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]