Remove IndexFieldData#clear since it is unused. (#60475)
This method was never called. It also seemed tricky that calling a method on `IndexFieldData` could clear the contents of a shared cache.
This commit is contained in:
parent
0022d316bb
commit
8ac81a3447
|
@ -541,11 +541,6 @@ public class ScaledFloatFieldMapper extends FieldMapper {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clear() {
|
|
||||||
scaledFieldData.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NumericType getNumericType() {
|
public NumericType getNumericType() {
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -86,11 +86,6 @@ public interface IndexFieldData<FD extends LeafFieldData> {
|
||||||
BucketedSort newBucketedSort(BigArrays bigArrays, @Nullable Object missingValue, MultiValueMode sortMode,
|
BucketedSort newBucketedSort(BigArrays bigArrays, @Nullable Object missingValue, MultiValueMode sortMode,
|
||||||
Nested nested, SortOrder sortOrder, DocValueFormat format, int bucketSize, BucketedSort.ExtraData extra);
|
Nested nested, SortOrder sortOrder, DocValueFormat format, int bucketSize, BucketedSort.ExtraData extra);
|
||||||
|
|
||||||
/**
|
|
||||||
* Clears any resources associated with this field data.
|
|
||||||
*/
|
|
||||||
void clear();
|
|
||||||
|
|
||||||
// we need this extended source we we have custom comparators to reuse our field data
|
// we need this extended source we we have custom comparators to reuse our field data
|
||||||
// in this case, we need to reduce type that will be used when search results are reduced
|
// in this case, we need to reduce type that will be used when search results are reduced
|
||||||
// on another node (we don't have the custom source them...)
|
// on another node (we don't have the custom source them...)
|
||||||
|
|
|
@ -44,8 +44,4 @@ public abstract class IndexHistogramFieldData implements IndexFieldData<LeafHist
|
||||||
return valuesSourceType;
|
return valuesSourceType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public final void clear() {
|
|
||||||
// can't do
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,9 +117,6 @@ public final class GlobalOrdinalsIndexFieldData implements IndexOrdinalsFieldDat
|
||||||
throw new IllegalArgumentException("only supported on numeric fields");
|
throw new IllegalArgumentException("only supported on numeric fields");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clear() {}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long ramBytesUsed() {
|
public long ramBytesUsed() {
|
||||||
return memorySizeInBytes;
|
return memorySizeInBytes;
|
||||||
|
@ -211,9 +208,6 @@ public final class GlobalOrdinalsIndexFieldData implements IndexOrdinalsFieldDat
|
||||||
throw new IllegalArgumentException("only supported on numeric fields");
|
throw new IllegalArgumentException("only supported on numeric fields");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clear() {}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long ramBytesUsed() {
|
public long ramBytesUsed() {
|
||||||
return memorySizeInBytes;
|
return memorySizeInBytes;
|
||||||
|
|
|
@ -58,11 +58,6 @@ public abstract class AbstractIndexFieldData<FD extends LeafFieldData> implement
|
||||||
return valuesSourceType;
|
return valuesSourceType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clear() {
|
|
||||||
cache.clear(fieldName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FD load(LeafReaderContext context) {
|
public FD load(LeafReaderContext context) {
|
||||||
if (context.reader().getFieldInfos().fieldInfo(fieldName) == null) {
|
if (context.reader().getFieldInfos().fieldInfo(fieldName) == null) {
|
||||||
|
|
|
@ -59,11 +59,6 @@ public abstract class AbstractLatLonPointIndexFieldData implements IndexGeoPoint
|
||||||
return valuesSourceType;
|
return valuesSourceType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public final void clear() {
|
|
||||||
// can't do
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SortField sortField(@Nullable Object missingValue, MultiValueMode sortMode, XFieldComparatorSource.Nested nested,
|
public SortField sortField(@Nullable Object missingValue, MultiValueMode sortMode, XFieldComparatorSource.Nested nested,
|
||||||
boolean reverse) {
|
boolean reverse) {
|
||||||
|
|
|
@ -69,10 +69,6 @@ public class BinaryIndexFieldData implements IndexFieldData<BinaryDVLeafFieldDat
|
||||||
return valuesSourceType;
|
return valuesSourceType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public final void clear() {
|
|
||||||
// can't do
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BinaryDVLeafFieldData load(LeafReaderContext context) {
|
public BinaryDVLeafFieldData load(LeafReaderContext context) {
|
||||||
|
|
|
@ -57,11 +57,6 @@ public class BytesBinaryIndexFieldData implements IndexFieldData<BytesBinaryDVLe
|
||||||
return valuesSourceType;
|
return valuesSourceType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public final void clear() {
|
|
||||||
// can't do
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SortField sortField(@Nullable Object missingValue, MultiValueMode sortMode, Nested nested, boolean reverse) {
|
public SortField sortField(@Nullable Object missingValue, MultiValueMode sortMode, Nested nested, boolean reverse) {
|
||||||
throw new IllegalArgumentException("can't sort on binary field");
|
throw new IllegalArgumentException("can't sort on binary field");
|
||||||
|
|
|
@ -146,10 +146,6 @@ public class ConstantIndexFieldData extends AbstractIndexOrdinalsFieldData {
|
||||||
atomicFieldData = new ConstantLeafFieldData(value);
|
atomicFieldData = new ConstantLeafFieldData(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clear() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final LeafOrdinalsFieldData load(LeafReaderContext context) {
|
public final LeafOrdinalsFieldData load(LeafReaderContext context) {
|
||||||
return atomicFieldData;
|
return atomicFieldData;
|
||||||
|
|
|
@ -92,11 +92,6 @@ public class SortedNumericIndexFieldData extends IndexNumericFieldData {
|
||||||
return valuesSourceType;
|
return valuesSourceType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public final void clear() {
|
|
||||||
// can't do
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean sortRequiresCustomComparator() {
|
protected boolean sortRequiresCustomComparator() {
|
||||||
return numericType == NumericType.HALF_FLOAT;
|
return numericType == NumericType.HALF_FLOAT;
|
||||||
|
|
|
@ -109,11 +109,6 @@ public class SortedSetOrdinalsIndexFieldData implements IndexOrdinalsFieldData {
|
||||||
return valuesSourceType;
|
return valuesSourceType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public final void clear() {
|
|
||||||
// can't do
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SortField sortField(@Nullable Object missingValue, MultiValueMode sortMode, Nested nested, boolean reverse) {
|
public SortField sortField(@Nullable Object missingValue, MultiValueMode sortMode, Nested nested, boolean reverse) {
|
||||||
XFieldComparatorSource source = new BytesRefFieldComparatorSource(this, missingValue, sortMode, nested);
|
XFieldComparatorSource source = new BytesRefFieldComparatorSource(this, missingValue, sortMode, nested);
|
||||||
|
|
|
@ -54,11 +54,6 @@ public class StringBinaryIndexFieldData implements IndexFieldData<StringBinaryDV
|
||||||
return valuesSourceType;
|
return valuesSourceType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public final void clear() {
|
|
||||||
// can't do
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SortField sortField(Object missingValue, MultiValueMode sortMode, Nested nested, boolean reverse) {
|
public SortField sortField(Object missingValue, MultiValueMode sortMode, Nested nested, boolean reverse) {
|
||||||
XFieldComparatorSource source = new BytesRefFieldComparatorSource(this, missingValue,
|
XFieldComparatorSource source = new BytesRefFieldComparatorSource(this, missingValue,
|
||||||
|
|
|
@ -209,12 +209,6 @@ public class IdFieldMapper extends MetadataFieldMapper {
|
||||||
Nested nested, SortOrder sortOrder, DocValueFormat format, int bucketSize, BucketedSort.ExtraData extra) {
|
Nested nested, SortOrder sortOrder, DocValueFormat format, int bucketSize, BucketedSort.ExtraData extra) {
|
||||||
throw new UnsupportedOperationException("can't sort on the [" + CONTENT_TYPE + "] field");
|
throw new UnsupportedOperationException("can't sort on the [" + CONTENT_TYPE + "] field");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clear() {
|
|
||||||
fieldData.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -69,11 +69,6 @@ public class NoOrdinalsStringFieldDataTests extends PagedBytesStringFieldDataTes
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clear() {
|
|
||||||
in.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -159,11 +159,6 @@ public class FunctionScoreTests extends ESTestCase {
|
||||||
SortOrder sortOrder, DocValueFormat format, int bucketSize, BucketedSort.ExtraData extra) {
|
SortOrder sortOrder, DocValueFormat format, int bucketSize, BucketedSort.ExtraData extra) {
|
||||||
throw new UnsupportedOperationException(UNSUPPORTED);
|
throw new UnsupportedOperationException(UNSUPPORTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clear() {
|
|
||||||
throw new UnsupportedOperationException(UNSUPPORTED);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -249,11 +244,6 @@ public class FunctionScoreTests extends ESTestCase {
|
||||||
protected boolean sortRequiresCustomComparator() {
|
protected boolean sortRequiresCustomComparator() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clear() {
|
|
||||||
throw new UnsupportedOperationException(UNSUPPORTED);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final ScoreFunction RANDOM_SCORE_FUNCTION = new RandomScoreFunction(0, 0, new IndexFieldDataStub());
|
private static final ScoreFunction RANDOM_SCORE_FUNCTION = new RandomScoreFunction(0, 0, new IndexFieldDataStub());
|
||||||
|
|
|
@ -374,11 +374,6 @@ public final class FlatObjectFieldMapper extends DynamicKeyFieldMapper {
|
||||||
throw new IllegalArgumentException("only supported on numeric fields");
|
throw new IllegalArgumentException("only supported on numeric fields");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clear() {
|
|
||||||
delegate.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LeafOrdinalsFieldData load(LeafReaderContext context) {
|
public LeafOrdinalsFieldData load(LeafReaderContext context) {
|
||||||
LeafOrdinalsFieldData fieldData = delegate.load(context);
|
LeafOrdinalsFieldData fieldData = delegate.load(context);
|
||||||
|
|
|
@ -42,11 +42,6 @@ public abstract class AbstractLatLonShapeIndexFieldData implements IndexGeoShape
|
||||||
return valuesSourceType;
|
return valuesSourceType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public final void clear() {
|
|
||||||
// can't do
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SortField sortField(@Nullable Object missingValue, MultiValueMode sortMode, XFieldComparatorSource.Nested nested,
|
public SortField sortField(@Nullable Object missingValue, MultiValueMode sortMode, XFieldComparatorSource.Nested nested,
|
||||||
boolean reverse) {
|
boolean reverse) {
|
||||||
|
|
|
@ -45,11 +45,6 @@ public class VectorIndexFieldData implements IndexFieldData<VectorDVLeafFieldDat
|
||||||
return valuesSourceType;
|
return valuesSourceType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public final void clear() {
|
|
||||||
// can't do
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SortField sortField(@Nullable Object missingValue, MultiValueMode sortMode, Nested nested, boolean reverse) {
|
public SortField sortField(@Nullable Object missingValue, MultiValueMode sortMode, Nested nested, boolean reverse) {
|
||||||
throw new IllegalArgumentException("can't sort on the vector field");
|
throw new IllegalArgumentException("can't sort on the vector field");
|
||||||
|
|
Loading…
Reference in New Issue