Remove AtomiFieldData#getLegacyFieldValues (#38087)

This function is unused now that we format the docvalue fields with the default
formatter on the field (#30831)
This commit is contained in:
Jim Ferenczi 2019-02-01 11:41:17 +01:00 committed by GitHub
parent bfd618cf83
commit 57b1d245e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 40 deletions

View File

@ -32,13 +32,6 @@ public interface AtomicFieldData extends Accountable, Releasable {
*/
ScriptDocValues<?> getScriptValues();
/**
* Returns field values for use by returned hits.
*/
default ScriptDocValues<?> getLegacyFieldValues() {
return getScriptValues();
}
/**
* Return a String representation of the values.
*/

View File

@ -25,11 +25,6 @@ import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType;
import org.elasticsearch.index.fielddata.ScriptDocValues;
import org.elasticsearch.index.fielddata.SortedBinaryDocValues;
import org.elasticsearch.index.fielddata.SortedNumericDoubleValues;
import org.elasticsearch.script.JodaCompatibleZonedDateTime;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import java.io.IOException;
/**
* Specialization of {@link AtomicNumericFieldData} for integers.
@ -52,34 +47,6 @@ abstract class AtomicLongFieldData implements AtomicNumericFieldData {
return ramBytesUsed;
}
@Override
public final ScriptDocValues<?> getLegacyFieldValues() {
switch (numericType) {
case DATE:
final ScriptDocValues.Dates realDV = new ScriptDocValues.Dates(getLongValues());
return new ScriptDocValues<DateTime>() {
@Override
public int size() {
return realDV.size();
}
@Override
public DateTime get(int index) {
JodaCompatibleZonedDateTime dt = realDV.get(index);
return new DateTime(dt.toInstant().toEpochMilli(), DateTimeZone.UTC);
}
@Override
public void setNextDocId(int docId) throws IOException {
realDV.setNextDocId(docId);
}
};
default:
return getScriptValues();
}
}
@Override
public final ScriptDocValues<?> getScriptValues() {
switch (numericType) {