LUCENE-10600: SortedSetDocValues#docValueCount should be an int, not long (#960)

This commit is contained in:
Lu Xugang 2022-06-16 12:22:05 +08:00 committed by GitHub
parent 0b5e0bfa4f
commit 78b7b17f93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 24 additions and 22 deletions

View File

@ -108,6 +108,8 @@ Bug Fixes
* GITHUB#956: Make sure KnnVectorQuery applies search boost. (Julie Tibshirani)
* LUCENE-10600: SortedSetDocValues#docValueCount should be an int, not long (Lu Xugang)
Other
---------------------

View File

@ -1561,7 +1561,7 @@ final class Lucene80DocValuesProducer extends DocValuesProducer {
int doc = -1;
long start, end;
long count;
int count;
@Override
public int nextDoc() throws IOException {
@ -1585,7 +1585,7 @@ final class Lucene80DocValuesProducer extends DocValuesProducer {
}
start = addresses.get(target);
end = addresses.get(target + 1L);
count = (end - start);
count = (int) (end - start);
return doc = target;
}
@ -1593,7 +1593,7 @@ final class Lucene80DocValuesProducer extends DocValuesProducer {
public boolean advanceExact(int target) throws IOException {
start = addresses.get(target);
end = addresses.get(target + 1L);
count = (end - start);
count = (int) (end - start);
doc = target;
return true;
}
@ -1607,7 +1607,7 @@ final class Lucene80DocValuesProducer extends DocValuesProducer {
}
@Override
public long docValueCount() {
public int docValueCount() {
return count;
}
};
@ -1626,7 +1626,7 @@ final class Lucene80DocValuesProducer extends DocValuesProducer {
boolean set;
long start;
long end = 0;
long count;
int count;
@Override
public int nextDoc() throws IOException {
@ -1661,7 +1661,7 @@ final class Lucene80DocValuesProducer extends DocValuesProducer {
final int index = disi.index();
start = addresses.get(index);
end = addresses.get(index + 1L);
count = end - start;
count = (int) (end - start);
set = true;
return true;
}
@ -1680,7 +1680,7 @@ final class Lucene80DocValuesProducer extends DocValuesProducer {
}
@Override
public long docValueCount() {
public int docValueCount() {
set();
return count;
}

View File

@ -728,7 +728,7 @@ class SimpleTextDocValuesReader extends DocValuesProducer {
}
@Override
public long docValueCount() {
public int docValueCount() {
return currentOrds.length;
}

View File

@ -948,7 +948,7 @@ public abstract class DocValuesConsumer implements Closeable {
}
@Override
public long docValueCount() {
public int docValueCount() {
return currentSub.values.docValueCount();
}

View File

@ -1453,7 +1453,7 @@ final class Lucene90DocValuesProducer extends DocValuesProducer {
}
@Override
public long docValueCount() {
public int docValueCount() {
return ords.docValueCount();
}

View File

@ -3337,7 +3337,7 @@ public final class CheckIndex implements Closeable {
LongBitSet seenOrds = new LongBitSet(dv.getValueCount());
long maxOrd2 = -1;
for (int docID = dv.nextDoc(); docID != NO_MORE_DOCS; docID = dv.nextDoc()) {
long count = dv.docValueCount();
int count = dv.docValueCount();
if (count == 0) {
throw new CheckIndexException(
"sortedset dv for field: "
@ -3348,7 +3348,7 @@ public final class CheckIndex implements Closeable {
if (dv2.advanceExact(docID) == false) {
throw new CheckIndexException("advanceExact did not find matching doc ID: " + docID);
}
long count2 = dv2.docValueCount();
int count2 = dv2.docValueCount();
if (count != count2) {
throw new CheckIndexException(
"advanceExact reports different value count: " + count + " != " + count2);

View File

@ -44,7 +44,7 @@ public class FilterSortedSetDocValues extends SortedSetDocValues {
}
@Override
public long docValueCount() {
public int docValueCount() {
return in.docValueCount();
}

View File

@ -938,7 +938,7 @@ public class MultiDocValues {
}
@Override
public long docValueCount() {
public int docValueCount() {
return currentValues.docValueCount();
}

View File

@ -58,7 +58,7 @@ final class SingletonSortedSetDocValues extends SortedSetDocValues {
}
@Override
public long docValueCount() {
public int docValueCount() {
return 1;
}

View File

@ -49,7 +49,7 @@ public abstract class SortedSetDocValues extends DocValuesIterator {
* zero. It is illegal to call this method after {@link #advanceExact(int)} returned {@code
* false}.
*/
public abstract long docValueCount();
public abstract int docValueCount();
/**
* Retrieves the value for the specified ordinal. The returned {@link BytesRef} may be re-used

View File

@ -311,7 +311,7 @@ class SortedSetDocValuesWriter extends DocValuesWriter<SortedSetDocValues> {
}
@Override
public long docValueCount() {
public int docValueCount() {
return ordCount;
}
@ -397,8 +397,8 @@ class SortedSetDocValuesWriter extends DocValuesWriter<SortedSetDocValues> {
}
@Override
public long docValueCount() {
return ords.ords.size();
public int docValueCount() {
return (int) ords.ords.size();
}
@Override

View File

@ -94,7 +94,7 @@ interface GenericTermsCollector extends Collector {
}
@Override
public long docValueCount() {
public int docValueCount() {
return target.docValueCount();
}

View File

@ -1155,7 +1155,7 @@ public class MemoryIndex {
}
@Override
public long docValueCount() {
public int docValueCount() {
return values.size();
}

View File

@ -1065,7 +1065,7 @@ public class AssertingLeafReader extends FilterLeafReader {
}
@Override
public long docValueCount() {
public int docValueCount() {
return in.docValueCount();
}