Skip to content

Commit

Permalink
Remove AtomiFieldData#getLegacyFieldValues
Browse files Browse the repository at this point in the history
This function is unused now that we format the docvalue fields with the default
formatter on the field (elastic#30831)
  • Loading branch information
jimczi committed Jan 31, 2019
1 parent 23805fa commit 2b7f0a4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@
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.
Expand All @@ -52,34 +47,6 @@ public long ramBytesUsed() {
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) {
Expand Down

0 comments on commit 2b7f0a4

Please sign in to comment.