removing unnecessary changes

This commit is contained in:
Benjamin Trent 2024-12-20 11:40:07 -05:00
parent cb6ab5484e
commit 6d0cb4fe32
9 changed files with 0 additions and 186 deletions

View File

@ -706,59 +706,4 @@ final class IndexedDISI extends DocIdSetIterator {
disi.word = rankWord;
disi.numberOfOnes = disi.denseOrigoIndex + denseNOO;
}
/**
* Implementation of a {@link DocIdSetIterator} which maps a source iterator to the indexes
* produced by an {@link IndexedDISI}.
*
* <p>This implementation assumes that all IDs produced by the source iterator are also present in
* the indexed iterator.
*
* @lucene.internal
*/
public static class MappedDISI extends DocIdSetIterator {
IndexedDISI indexedDISI;
DocIdSetIterator sourceDISI;
public MappedDISI(IndexedDISI indexedDISI, DocIdSetIterator sourceDISI) {
this.indexedDISI = indexedDISI;
this.sourceDISI = sourceDISI;
}
/**
* Advances the source iterator to the first document number that is greater than or equal to
* the provided target and returns the corresponding index.
*/
@Override
public int advance(int target) throws IOException {
int newTarget = sourceDISI.advance(target);
if (newTarget != NO_MORE_DOCS) {
indexedDISI.advance(newTarget);
}
return docID();
}
@Override
public long cost() {
return this.sourceDISI.cost();
}
@Override
public int docID() {
if (indexedDISI.docID() == NO_MORE_DOCS || sourceDISI.docID() == NO_MORE_DOCS) {
return NO_MORE_DOCS;
}
return indexedDISI.index();
}
/** Advances to the next document in the source iterator and returns the corresponding index. */
@Override
public int nextDoc() throws IOException {
int newTarget = sourceDISI.nextDoc();
if (newTarget != NO_MORE_DOCS) {
indexedDISI.advance(newTarget);
}
return docID();
}
}
}

View File

@ -216,11 +216,6 @@ abstract class OffHeapFloatVectorValues extends FloatVectorValues {
}
};
}
@Override
public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) {
return new IndexedDISI.MappedDISI(disi, docIds);
}
}
private static class EmptyOffHeapVectorValues extends OffHeapFloatVectorValues {
@ -268,10 +263,5 @@ abstract class OffHeapFloatVectorValues extends FloatVectorValues {
public VectorScorer scorer(float[] query) {
return null;
}
@Override
public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) {
return DocIdSetIterator.empty();
}
}
}

View File

@ -230,11 +230,6 @@ abstract class OffHeapByteVectorValues extends ByteVectorValues {
}
};
}
@Override
public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) {
return new IndexedDISI.MappedDISI(disi, docIds);
}
}
private static class EmptyOffHeapVectorValues extends OffHeapByteVectorValues {
@ -282,10 +277,5 @@ abstract class OffHeapByteVectorValues extends ByteVectorValues {
public VectorScorer scorer(byte[] query) {
return null;
}
@Override
public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) {
return DocIdSetIterator.empty();
}
}
}

View File

@ -229,11 +229,6 @@ abstract class OffHeapFloatVectorValues extends FloatVectorValues {
}
};
}
@Override
public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) {
return new IndexedDISI.MappedDISI(disi, docIds);
}
}
private static class EmptyOffHeapVectorValues extends OffHeapFloatVectorValues {
@ -281,10 +276,5 @@ abstract class OffHeapFloatVectorValues extends FloatVectorValues {
public VectorScorer scorer(float[] query) {
return null;
}
@Override
public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) {
return DocIdSetIterator.empty();
}
}
}

View File

@ -758,59 +758,4 @@ public final class IndexedDISI extends DocIdSetIterator {
disi.word = rankWord;
disi.numberOfOnes = disi.denseOrigoIndex + denseNOO;
}
/**
* Implementation of a {@link DocIdSetIterator} which maps a source iterator to the indexes
* produced by an {@link IndexedDISI}.
*
* <p>This implementation assumes that all IDs produced by the source iterator are also present in
* the indexed iterator.
*
* @lucene.internal
*/
public static class MappedDISI extends DocIdSetIterator {
IndexedDISI indexedDISI;
DocIdSetIterator sourceDISI;
public MappedDISI(IndexedDISI indexedDISI, DocIdSetIterator sourceDISI) {
this.indexedDISI = indexedDISI;
this.sourceDISI = sourceDISI;
}
/**
* Advances the source iterator to the first document number that is greater than or equal to
* the provided target and returns the corresponding index.
*/
@Override
public int advance(int target) throws IOException {
int newTarget = sourceDISI.advance(target);
if (newTarget != NO_MORE_DOCS) {
indexedDISI.advance(newTarget);
}
return docID();
}
@Override
public long cost() {
return this.sourceDISI.cost();
}
@Override
public int docID() {
if (indexedDISI.docID() == NO_MORE_DOCS || sourceDISI.docID() == NO_MORE_DOCS) {
return NO_MORE_DOCS;
}
return indexedDISI.index();
}
/** Advances to the next document in the source iterator and returns the corresponding index. */
@Override
public int nextDoc() throws IOException {
int newTarget = sourceDISI.nextDoc();
if (newTarget != NO_MORE_DOCS) {
indexedDISI.advance(newTarget);
}
return docID();
}
}
}

View File

@ -272,11 +272,6 @@ public abstract class OffHeapByteVectorValues extends ByteVectorValues implement
}
};
}
@Override
public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) {
return new IndexedDISI.MappedDISI(disi, docIds);
}
}
private static class EmptyOffHeapVectorValues extends OffHeapByteVectorValues {
@ -327,10 +322,5 @@ public abstract class OffHeapByteVectorValues extends ByteVectorValues implement
public VectorScorer scorer(byte[] query) {
return null;
}
@Override
public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) {
return DocIdSetIterator.empty();
}
}
}

View File

@ -268,11 +268,6 @@ public abstract class OffHeapFloatVectorValues extends FloatVectorValues impleme
}
};
}
@Override
public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) {
return new IndexedDISI.MappedDISI(disi, docIds);
}
}
private static class EmptyOffHeapVectorValues extends OffHeapFloatVectorValues {
@ -318,10 +313,5 @@ public abstract class OffHeapFloatVectorValues extends FloatVectorValues impleme
public VectorScorer scorer(float[] query) {
return null;
}
@Override
public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) {
return DocIdSetIterator.empty();
}
}
}

View File

@ -19,7 +19,6 @@ package org.apache.lucene.index;
import java.io.IOException;
import java.util.List;
import org.apache.lucene.document.KnnByteVectorField;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.VectorScorer;
/**
@ -65,18 +64,6 @@ public abstract class ByteVectorValues extends KnnVectorValues {
}
}
/**
* Returns a new iterator that maps the provided docIds to the vector ordinals.
*
* <p>This method assumes that all docIds have corresponding ordinals.
*
* @lucene.internal
* @lucene.experimental
*/
public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) {
return docIds;
}
/**
* Return a {@link VectorScorer} for the given query vector.
*

View File

@ -19,7 +19,6 @@ package org.apache.lucene.index;
import java.io.IOException;
import java.util.List;
import org.apache.lucene.document.KnnFloatVectorField;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.VectorScorer;
/**
@ -65,18 +64,6 @@ public abstract class FloatVectorValues extends KnnVectorValues {
}
}
/**
* Returns a new iterator that maps the provided docIds to the vector ordinals.
*
* <p>This method assumes that all docIds have corresponding ordinals.
*
* @lucene.internal
* @lucene.experimental
*/
public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) {
return docIds;
}
/**
* Return a {@link VectorScorer} for the given query vector and the current {@link
* FloatVectorValues}.