Try to prevent classloading deadlock.

Closes #19316
This commit is contained in:
Adrien Grand 2016-07-18 17:43:47 +02:00
parent e3d3f6b1f1
commit 3bb6a4dea6
2 changed files with 20 additions and 20 deletions

View File

@ -70,7 +70,7 @@ public class AggregationContext {
} else if (config.valueSourceType() == ValuesSourceType.GEOPOINT) {
vs = (VS) ValuesSource.GeoPoint.EMPTY;
} else if (config.valueSourceType() == ValuesSourceType.ANY || config.valueSourceType() == ValuesSourceType.BYTES) {
vs = (VS) ValuesSource.Bytes.EMPTY;
vs = (VS) ValuesSource.Bytes.WithOrdinals.EMPTY;
} else {
throw new SearchParseException(searchContext, "Can't deal with unmapped ValuesSource type "
+ config.valueSourceType(), null);

View File

@ -69,25 +69,6 @@ public abstract class ValuesSource {
public abstract static class Bytes extends ValuesSource {
public static final WithOrdinals EMPTY = new WithOrdinals() {
@Override
public RandomAccessOrds ordinalsValues(LeafReaderContext context) {
return DocValues.emptySortedSet();
}
@Override
public RandomAccessOrds globalOrdinalsValues(LeafReaderContext context) {
return DocValues.emptySortedSet();
}
@Override
public SortedBinaryDocValues bytesValues(LeafReaderContext context) throws IOException {
return org.elasticsearch.index.fielddata.FieldData.emptySortedBinary(context.reader().maxDoc());
}
};
@Override
public Bits docsWithValue(LeafReaderContext context) throws IOException {
final SortedBinaryDocValues bytes = bytesValues(context);
@ -100,6 +81,25 @@ public abstract class ValuesSource {
public abstract static class WithOrdinals extends Bytes {
public static final WithOrdinals EMPTY = new WithOrdinals() {
@Override
public RandomAccessOrds ordinalsValues(LeafReaderContext context) {
return DocValues.emptySortedSet();
}
@Override
public RandomAccessOrds globalOrdinalsValues(LeafReaderContext context) {
return DocValues.emptySortedSet();
}
@Override
public SortedBinaryDocValues bytesValues(LeafReaderContext context) throws IOException {
return org.elasticsearch.index.fielddata.FieldData.emptySortedBinary(context.reader().maxDoc());
}
};
@Override
public Bits docsWithValue(LeafReaderContext context) {
final RandomAccessOrds ordinals = ordinalsValues(context);