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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
scaledFieldData.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NumericType getNumericType() {
|
||||
/*
|
||||
|
|
|
@ -86,11 +86,6 @@ public interface IndexFieldData<FD extends LeafFieldData> {
|
|||
BucketedSort newBucketedSort(BigArrays bigArrays, @Nullable Object missingValue, MultiValueMode sortMode,
|
||||
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
|
||||
// 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...)
|
||||
|
|
|
@ -44,8 +44,4 @@ public abstract class IndexHistogramFieldData implements IndexFieldData<LeafHist
|
|||
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");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {}
|
||||
|
||||
@Override
|
||||
public long ramBytesUsed() {
|
||||
return memorySizeInBytes;
|
||||
|
@ -211,9 +208,6 @@ public final class GlobalOrdinalsIndexFieldData implements IndexOrdinalsFieldDat
|
|||
throw new IllegalArgumentException("only supported on numeric fields");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {}
|
||||
|
||||
@Override
|
||||
public long ramBytesUsed() {
|
||||
return memorySizeInBytes;
|
||||
|
|
|
@ -58,11 +58,6 @@ public abstract class AbstractIndexFieldData<FD extends LeafFieldData> implement
|
|||
return valuesSourceType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
cache.clear(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FD load(LeafReaderContext context) {
|
||||
if (context.reader().getFieldInfos().fieldInfo(fieldName) == null) {
|
||||
|
|
|
@ -59,11 +59,6 @@ public abstract class AbstractLatLonPointIndexFieldData implements IndexGeoPoint
|
|||
return valuesSourceType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void clear() {
|
||||
// can't do
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortField sortField(@Nullable Object missingValue, MultiValueMode sortMode, XFieldComparatorSource.Nested nested,
|
||||
boolean reverse) {
|
||||
|
|
|
@ -69,10 +69,6 @@ public class BinaryIndexFieldData implements IndexFieldData<BinaryDVLeafFieldDat
|
|||
return valuesSourceType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void clear() {
|
||||
// can't do
|
||||
}
|
||||
|
||||
@Override
|
||||
public BinaryDVLeafFieldData load(LeafReaderContext context) {
|
||||
|
|
|
@ -57,11 +57,6 @@ public class BytesBinaryIndexFieldData implements IndexFieldData<BytesBinaryDVLe
|
|||
return valuesSourceType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void clear() {
|
||||
// can't do
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortField sortField(@Nullable Object missingValue, MultiValueMode sortMode, Nested nested, boolean reverse) {
|
||||
throw new IllegalArgumentException("can't sort on binary field");
|
||||
|
|
|
@ -146,10 +146,6 @@ public class ConstantIndexFieldData extends AbstractIndexOrdinalsFieldData {
|
|||
atomicFieldData = new ConstantLeafFieldData(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public final LeafOrdinalsFieldData load(LeafReaderContext context) {
|
||||
return atomicFieldData;
|
||||
|
|
|
@ -92,11 +92,6 @@ public class SortedNumericIndexFieldData extends IndexNumericFieldData {
|
|||
return valuesSourceType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void clear() {
|
||||
// can't do
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean sortRequiresCustomComparator() {
|
||||
return numericType == NumericType.HALF_FLOAT;
|
||||
|
|
|
@ -109,11 +109,6 @@ public class SortedSetOrdinalsIndexFieldData implements IndexOrdinalsFieldData {
|
|||
return valuesSourceType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void clear() {
|
||||
// can't do
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortField sortField(@Nullable Object missingValue, MultiValueMode sortMode, Nested nested, boolean reverse) {
|
||||
XFieldComparatorSource source = new BytesRefFieldComparatorSource(this, missingValue, sortMode, nested);
|
||||
|
|
|
@ -54,11 +54,6 @@ public class StringBinaryIndexFieldData implements IndexFieldData<StringBinaryDV
|
|||
return valuesSourceType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void clear() {
|
||||
// can't do
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortField sortField(Object missingValue, MultiValueMode sortMode, Nested nested, boolean reverse) {
|
||||
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) {
|
||||
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();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
in.clear();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -159,11 +159,6 @@ public class FunctionScoreTests extends ESTestCase {
|
|||
SortOrder sortOrder, DocValueFormat format, int bucketSize, BucketedSort.ExtraData extra) {
|
||||
throw new UnsupportedOperationException(UNSUPPORTED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
throw new UnsupportedOperationException(UNSUPPORTED);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -249,11 +244,6 @@ public class FunctionScoreTests extends ESTestCase {
|
|||
protected boolean sortRequiresCustomComparator() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
throw new UnsupportedOperationException(UNSUPPORTED);
|
||||
}
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
delegate.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public LeafOrdinalsFieldData load(LeafReaderContext context) {
|
||||
LeafOrdinalsFieldData fieldData = delegate.load(context);
|
||||
|
|
|
@ -42,11 +42,6 @@ public abstract class AbstractLatLonShapeIndexFieldData implements IndexGeoShape
|
|||
return valuesSourceType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void clear() {
|
||||
// can't do
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortField sortField(@Nullable Object missingValue, MultiValueMode sortMode, XFieldComparatorSource.Nested nested,
|
||||
boolean reverse) {
|
||||
|
|
|
@ -45,11 +45,6 @@ public class VectorIndexFieldData implements IndexFieldData<VectorDVLeafFieldDat
|
|||
return valuesSourceType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void clear() {
|
||||
// can't do
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortField sortField(@Nullable Object missingValue, MultiValueMode sortMode, Nested nested, boolean reverse) {
|
||||
throw new IllegalArgumentException("can't sort on the vector field");
|
||||
|
|
Loading…
Reference in New Issue