Skip to content

Commit

Permalink
Remove hppc from percentiles agg
Browse files Browse the repository at this point in the history
The percentiles bucket agg uses an hppc arraylist of doubles to store
the parsed percent values. This is a very small list and does not need
to be a native array. This commit changes to using a standard ArrayList.

relates elastic#84735
  • Loading branch information
rjernst committed Apr 20, 2022
1 parent b2c9028 commit a996ed2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

package org.elasticsearch.search.aggregations.pipeline;

import com.carrotsearch.hppc.DoubleArrayList;

import org.elasticsearch.Version;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
Expand All @@ -18,7 +16,9 @@
import org.elasticsearch.xcontent.XContentParser;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;

Expand Down Expand Up @@ -152,7 +152,7 @@ protected PercentilesBucketPipelineAggregationBuilder buildFactory(
protected boolean token(XContentParser parser, String field, XContentParser.Token token, Map<String, Object> params)
throws IOException {
if (PERCENTS_FIELD.match(field, parser.getDeprecationHandler()) && token == XContentParser.Token.START_ARRAY) {
DoubleArrayList percents = new DoubleArrayList(10);
List<Double> percents = new ArrayList<>(10);
while (parser.nextToken() != XContentParser.Token.END_ARRAY) {
percents.add(parser.doubleValue());
}
Expand Down

0 comments on commit a996ed2

Please sign in to comment.