Skip to content

Commit

Permalink
HSEARCH-3892 Remove unused methods from TextMultiValues
Browse files Browse the repository at this point in the history
  • Loading branch information
yrodiere committed Apr 15, 2020
1 parent f628a41 commit 93945d3
Showing 1 changed file with 0 additions and 39 deletions.
Expand Up @@ -9,7 +9,6 @@
import java.io.IOException;

import org.apache.lucene.index.SortedSetDocValues;
import org.apache.lucene.util.BytesRef;

/**
* A per-document, unordered sequence of text ordinals.
Expand Down Expand Up @@ -49,31 +48,13 @@ protected TextMultiValues() {
*/
public abstract long nextOrd() throws IOException;


/** Retrieves the value for the specified ordinal. The returned
* {@link BytesRef} may be re-used across calls to lookupOrd so make sure to
* {@link BytesRef#deepCopyOf(BytesRef) copy it} if you want to keep it
* around.
* @param ord ordinal to lookup
* @see #nextOrd
*/
public abstract BytesRef lookupOrd(long ord) throws IOException;

/**
* Returns the number of unique values.
* @return number of unique values in this SortedDocValues. This is
* also equivalent to one plus the maximum ordinal.
*/
public abstract long getValueCount();

/** If {@code key} exists, returns its ordinal, else
* returns {@code -insertionPoint-1}, like {@code
* Arrays.binarySearch}.
*
* @param key Key to look up
**/
public abstract long lookupTerm(BytesRef key) throws IOException;

public static TextMultiValues fromDocValues(SortedSetDocValues docValues) {
return new DocValuesTextMultiValues( docValues );
}
Expand All @@ -98,20 +79,10 @@ public long nextOrd() {
throw new UnsupportedOperationException();
}

@Override
public BytesRef lookupOrd(long ord) throws IOException {
throw new IllegalArgumentException( "Ord " + ord + " is too large" );
}

@Override
public long getValueCount() {
return 0;
}

@Override
public long lookupTerm(BytesRef key) throws IOException {
return -1;
}
};

protected static class DocValuesTextMultiValues extends TextMultiValues {
Expand Down Expand Up @@ -142,19 +113,9 @@ public long nextOrd() throws IOException {
return result;
}

@Override
public BytesRef lookupOrd(long ord) throws IOException {
return values.lookupOrd( ord );
}

@Override
public long getValueCount() {
return values.getValueCount();
}

@Override
public long lookupTerm(BytesRef key) throws IOException {
return values.lookupTerm( key );
}
}
}

0 comments on commit 93945d3

Please sign in to comment.