msokolov commented on a change in pull request #601:
URL: https://github.com/apache/lucene/pull/601#discussion_r784071103
##########
File path: lucene/core/src/java/org/apache/lucene/codecs/KnnVectorsWriter.java
##########
@@ -271,52 +207,5 @@ public long cost() {
public int dimension() {
return subs.get(0).values.dimension();
}
-
- class MergerRandomAccess implements RandomAccessVectorValues {
-
- private final List<RandomAccessVectorValues> raSubs;
-
- MergerRandomAccess() {
- raSubs = new ArrayList<>(subs.size());
- for (VectorValuesSub sub : subs) {
- if (sub.values instanceof RandomAccessVectorValuesProducer) {
- raSubs.add(((RandomAccessVectorValuesProducer)
sub.values).randomAccess());
- } else {
- throw new IllegalStateException(
- "Cannot merge VectorValues without support for random access");
- }
- }
- }
-
- @Override
- public int size() {
- return size;
- }
-
- @Override
- public int dimension() {
- return VectorValuesMerger.this.dimension();
- }
-
- @Override
- public float[] vectorValue(int target) throws IOException {
- int unmappedOrd = ordMap[target];
- int segmentOrd = Arrays.binarySearch(ordBase, unmappedOrd);
Review comment:
so glad to see this gone-zo
##########
File path: lucene/core/src/java/org/apache/lucene/codecs/KnnVectorsWriter.java
##########
@@ -247,11 +188,6 @@ public BytesRef binaryValue() throws IOException {
return current.values.binaryValue();
}
- @Override
- public RandomAccessVectorValues randomAccess() {
- return new MergerRandomAccess();
- }
Review comment:
heh - it's nice that pursuing what looks like a formal problem (yucky
API) also leads to real efficiency gains.
--
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]