Rename PipelineAggregatorBuilder to PipelineAggregationBuilder.
This is a follow-up to #18377.
This commit is contained in:
parent
d72e79159e
commit
712e387058
|
@ -29,7 +29,7 @@ import org.elasticsearch.script.Script;
|
|||
import org.elasticsearch.script.Template;
|
||||
import org.elasticsearch.search.Scroll;
|
||||
import org.elasticsearch.search.aggregations.AggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.slice.SliceBuilder;
|
||||
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
||||
import org.elasticsearch.search.highlight.HighlightBuilder;
|
||||
|
@ -387,7 +387,7 @@ public class SearchRequestBuilder extends ActionRequestBuilder<SearchRequest, Se
|
|||
/**
|
||||
* Adds an aggregation to the search operation.
|
||||
*/
|
||||
public SearchRequestBuilder addAggregation(PipelineAggregatorBuilder aggregation) {
|
||||
public SearchRequestBuilder addAggregation(PipelineAggregationBuilder aggregation) {
|
||||
sourceBuilder().aggregation(aggregation);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ import org.elasticsearch.search.action.SearchTransportService;
|
|||
import org.elasticsearch.search.aggregations.Aggregator;
|
||||
import org.elasticsearch.search.aggregations.AggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.AggregatorParsers;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.bucket.children.ChildrenAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.bucket.children.InternalChildren;
|
||||
import org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder;
|
||||
|
@ -200,31 +200,31 @@ import org.elasticsearch.search.aggregations.pipeline.InternalSimpleValue;
|
|||
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.InternalBucketMetricValue;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.avg.AvgBucketPipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.avg.AvgBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.avg.AvgBucketPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.max.MaxBucketPipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.max.MaxBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.max.MaxBucketPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.min.MinBucketPipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.min.MinBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.min.MinBucketPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.percentile.PercentilesBucketPipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.percentile.PercentilesBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.percentile.PercentilesBucketPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.StatsBucketPipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.StatsBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.StatsBucketPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.extended.ExtendedStatsBucketParser;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.extended.ExtendedStatsBucketPipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.extended.ExtendedStatsBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.extended.ExtendedStatsBucketPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.sum.SumBucketPipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.sum.SumBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.sum.SumBucketPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketscript.BucketScriptPipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketscript.BucketScriptPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketscript.BucketScriptPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketselector.BucketSelectorPipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketselector.BucketSelectorPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketselector.BucketSelectorPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.cumulativesum.CumulativeSumPipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.cumulativesum.CumulativeSumPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.cumulativesum.CumulativeSumPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.derivative.DerivativePipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.derivative.DerivativePipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.derivative.DerivativePipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.derivative.InternalDerivative;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.models.EwmaModel;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.models.HoltLinearModel;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.models.HoltWintersModel;
|
||||
|
@ -232,7 +232,7 @@ import org.elasticsearch.search.aggregations.pipeline.movavg.models.LinearModel;
|
|||
import org.elasticsearch.search.aggregations.pipeline.movavg.models.MovAvgModel;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.models.SimpleModel;
|
||||
import org.elasticsearch.search.aggregations.pipeline.serialdiff.SerialDiffPipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.serialdiff.SerialDiffPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.serialdiff.SerialDiffPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.controller.SearchPhaseController;
|
||||
import org.elasticsearch.search.fetch.FetchPhase;
|
||||
import org.elasticsearch.search.fetch.FetchSubPhase;
|
||||
|
@ -433,10 +433,10 @@ public class SearchModule extends AbstractModule {
|
|||
* @param aggregationName names by which the aggregation may be parsed. The first name is special because it is the name that the reader
|
||||
* is registered under.
|
||||
*/
|
||||
public void registerPipelineAggregation(Writeable.Reader<? extends PipelineAggregatorBuilder> reader,
|
||||
public void registerPipelineAggregation(Writeable.Reader<? extends PipelineAggregationBuilder> reader,
|
||||
PipelineAggregator.Parser aggregationParser, ParseField aggregationName) {
|
||||
pipelineAggregationParserRegistry.register(aggregationParser, aggregationName);
|
||||
namedWriteableRegistry.register(PipelineAggregatorBuilder.class, aggregationName.getPreferredName(), reader);
|
||||
namedWriteableRegistry.register(PipelineAggregationBuilder.class, aggregationName.getPreferredName(), reader);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -500,33 +500,33 @@ public class SearchModule extends AbstractModule {
|
|||
ScriptedMetricAggregationBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerAggregation(ChildrenAggregationBuilder::new, ChildrenAggregationBuilder::parse,
|
||||
ChildrenAggregationBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(DerivativePipelineAggregatorBuilder::new, DerivativePipelineAggregatorBuilder::parse,
|
||||
DerivativePipelineAggregatorBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(MaxBucketPipelineAggregatorBuilder::new, MaxBucketPipelineAggregatorBuilder.PARSER,
|
||||
MaxBucketPipelineAggregatorBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(MinBucketPipelineAggregatorBuilder::new, MinBucketPipelineAggregatorBuilder.PARSER,
|
||||
MinBucketPipelineAggregatorBuilder.AGGREGATION_FIELD_NAME);
|
||||
registerPipelineAggregation(AvgBucketPipelineAggregatorBuilder::new, AvgBucketPipelineAggregatorBuilder.PARSER,
|
||||
AvgBucketPipelineAggregatorBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(SumBucketPipelineAggregatorBuilder::new, SumBucketPipelineAggregatorBuilder.PARSER,
|
||||
SumBucketPipelineAggregatorBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(StatsBucketPipelineAggregatorBuilder::new, StatsBucketPipelineAggregatorBuilder.PARSER,
|
||||
StatsBucketPipelineAggregatorBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(ExtendedStatsBucketPipelineAggregatorBuilder::new, new ExtendedStatsBucketParser(),
|
||||
ExtendedStatsBucketPipelineAggregatorBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(PercentilesBucketPipelineAggregatorBuilder::new, PercentilesBucketPipelineAggregatorBuilder.PARSER,
|
||||
PercentilesBucketPipelineAggregatorBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(MovAvgPipelineAggregatorBuilder::new,
|
||||
(n, c) -> MovAvgPipelineAggregatorBuilder.parse(movingAverageModelParserRegistry, n, c),
|
||||
MovAvgPipelineAggregatorBuilder.AGGREGATION_FIELD_NAME);
|
||||
registerPipelineAggregation(CumulativeSumPipelineAggregatorBuilder::new, CumulativeSumPipelineAggregatorBuilder::parse,
|
||||
CumulativeSumPipelineAggregatorBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(BucketScriptPipelineAggregatorBuilder::new, BucketScriptPipelineAggregatorBuilder::parse,
|
||||
BucketScriptPipelineAggregatorBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(BucketSelectorPipelineAggregatorBuilder::new, BucketSelectorPipelineAggregatorBuilder::parse,
|
||||
BucketSelectorPipelineAggregatorBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(SerialDiffPipelineAggregatorBuilder::new, SerialDiffPipelineAggregatorBuilder::parse,
|
||||
SerialDiffPipelineAggregatorBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(DerivativePipelineAggregationBuilder::new, DerivativePipelineAggregationBuilder::parse,
|
||||
DerivativePipelineAggregationBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(MaxBucketPipelineAggregationBuilder::new, MaxBucketPipelineAggregationBuilder.PARSER,
|
||||
MaxBucketPipelineAggregationBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(MinBucketPipelineAggregationBuilder::new, MinBucketPipelineAggregationBuilder.PARSER,
|
||||
MinBucketPipelineAggregationBuilder.AGGREGATION_FIELD_NAME);
|
||||
registerPipelineAggregation(AvgBucketPipelineAggregationBuilder::new, AvgBucketPipelineAggregationBuilder.PARSER,
|
||||
AvgBucketPipelineAggregationBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(SumBucketPipelineAggregationBuilder::new, SumBucketPipelineAggregationBuilder.PARSER,
|
||||
SumBucketPipelineAggregationBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(StatsBucketPipelineAggregationBuilder::new, StatsBucketPipelineAggregationBuilder.PARSER,
|
||||
StatsBucketPipelineAggregationBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(ExtendedStatsBucketPipelineAggregationBuilder::new, new ExtendedStatsBucketParser(),
|
||||
ExtendedStatsBucketPipelineAggregationBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(PercentilesBucketPipelineAggregationBuilder::new, PercentilesBucketPipelineAggregationBuilder.PARSER,
|
||||
PercentilesBucketPipelineAggregationBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(MovAvgPipelineAggregationBuilder::new,
|
||||
(n, c) -> MovAvgPipelineAggregationBuilder.parse(movingAverageModelParserRegistry, n, c),
|
||||
MovAvgPipelineAggregationBuilder.AGGREGATION_FIELD_NAME);
|
||||
registerPipelineAggregation(CumulativeSumPipelineAggregationBuilder::new, CumulativeSumPipelineAggregationBuilder::parse,
|
||||
CumulativeSumPipelineAggregationBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(BucketScriptPipelineAggregationBuilder::new, BucketScriptPipelineAggregationBuilder::parse,
|
||||
BucketScriptPipelineAggregationBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(BucketSelectorPipelineAggregationBuilder::new, BucketSelectorPipelineAggregationBuilder::parse,
|
||||
BucketSelectorPipelineAggregationBuilder.AGGREGATION_NAME_FIELD);
|
||||
registerPipelineAggregation(SerialDiffPipelineAggregationBuilder::new, SerialDiffPipelineAggregationBuilder::parse,
|
||||
SerialDiffPipelineAggregationBuilder.AGGREGATION_NAME_FIELD);
|
||||
bind(AggregatorParsers.class).toInstance(aggregatorParsers);
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ public abstract class AbstractAggregationBuilder<AB extends AbstractAggregationB
|
|||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public AB subAggregation(PipelineAggregatorBuilder aggregation) {
|
||||
public AB subAggregation(PipelineAggregationBuilder aggregation) {
|
||||
if (aggregation == null) {
|
||||
throw new IllegalArgumentException("[aggregation] must not be null: [" + name + "]");
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ public abstract class AggregationBuilder
|
|||
public abstract AggregationBuilder subAggregation(AggregationBuilder aggregation);
|
||||
|
||||
/** Add a sub aggregation to this builder. */
|
||||
public abstract AggregationBuilder subAggregation(PipelineAggregatorBuilder aggregation);
|
||||
public abstract AggregationBuilder subAggregation(PipelineAggregationBuilder aggregation);
|
||||
|
||||
/**
|
||||
* Internal: Registers sub-factories with this factory. The sub-factory will be
|
||||
|
|
|
@ -46,18 +46,18 @@ import java.util.Set;
|
|||
public class AggregatorFactories {
|
||||
|
||||
public static final AggregatorFactories EMPTY = new AggregatorFactories(null, new AggregatorFactory<?>[0],
|
||||
new ArrayList<PipelineAggregatorBuilder>());
|
||||
new ArrayList<PipelineAggregationBuilder>());
|
||||
|
||||
private AggregatorFactory<?> parent;
|
||||
private AggregatorFactory<?>[] factories;
|
||||
private List<PipelineAggregatorBuilder> pipelineAggregatorFactories;
|
||||
private List<PipelineAggregationBuilder> pipelineAggregatorFactories;
|
||||
|
||||
public static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
private AggregatorFactories(AggregatorFactory<?> parent, AggregatorFactory<?>[] factories,
|
||||
List<PipelineAggregatorBuilder> pipelineAggregators) {
|
||||
List<PipelineAggregationBuilder> pipelineAggregators) {
|
||||
this.parent = parent;
|
||||
this.factories = factories;
|
||||
this.pipelineAggregatorFactories = pipelineAggregators;
|
||||
|
@ -65,7 +65,7 @@ public class AggregatorFactories {
|
|||
|
||||
public List<PipelineAggregator> createPipelineAggregators() throws IOException {
|
||||
List<PipelineAggregator> pipelineAggregators = new ArrayList<>();
|
||||
for (PipelineAggregatorBuilder factory : this.pipelineAggregatorFactories) {
|
||||
for (PipelineAggregationBuilder factory : this.pipelineAggregatorFactories) {
|
||||
pipelineAggregators.add(factory.create());
|
||||
}
|
||||
return pipelineAggregators;
|
||||
|
@ -128,7 +128,7 @@ public class AggregatorFactories {
|
|||
for (AggregatorFactory<?> factory : factories) {
|
||||
factory.validate();
|
||||
}
|
||||
for (PipelineAggregatorBuilder factory : pipelineAggregatorFactories) {
|
||||
for (PipelineAggregationBuilder factory : pipelineAggregatorFactories) {
|
||||
factory.validate(parent, factories, pipelineAggregatorFactories);
|
||||
}
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ public class AggregatorFactories {
|
|||
public static class Builder extends ToXContentToBytes implements Writeable {
|
||||
private final Set<String> names = new HashSet<>();
|
||||
private final List<AggregationBuilder> aggregationBuilders = new ArrayList<>();
|
||||
private final List<PipelineAggregatorBuilder> pipelineAggregatorBuilders = new ArrayList<>();
|
||||
private final List<PipelineAggregationBuilder> pipelineAggregatorBuilders = new ArrayList<>();
|
||||
private boolean skipResolveOrder;
|
||||
|
||||
/**
|
||||
|
@ -155,7 +155,7 @@ public class AggregatorFactories {
|
|||
}
|
||||
int pipelineFactoriesSize = in.readVInt();
|
||||
for (int i = 0; i < pipelineFactoriesSize; i++) {
|
||||
addPipelineAggregator(in.readNamedWriteable(PipelineAggregatorBuilder.class));
|
||||
addPipelineAggregator(in.readNamedWriteable(PipelineAggregationBuilder.class));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ public class AggregatorFactories {
|
|||
out.writeNamedWriteable(factory);
|
||||
}
|
||||
out.writeVInt(this.pipelineAggregatorBuilders.size());
|
||||
for (PipelineAggregatorBuilder factory : pipelineAggregatorBuilders) {
|
||||
for (PipelineAggregationBuilder factory : pipelineAggregatorBuilders) {
|
||||
out.writeNamedWriteable(factory);
|
||||
}
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ public class AggregatorFactories {
|
|||
return this;
|
||||
}
|
||||
|
||||
public Builder addPipelineAggregator(PipelineAggregatorBuilder pipelineAggregatorFactory) {
|
||||
public Builder addPipelineAggregator(PipelineAggregationBuilder pipelineAggregatorFactory) {
|
||||
this.pipelineAggregatorBuilders.add(pipelineAggregatorFactory);
|
||||
return this;
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ public class AggregatorFactories {
|
|||
if (aggregationBuilders.isEmpty() && pipelineAggregatorBuilders.isEmpty()) {
|
||||
return EMPTY;
|
||||
}
|
||||
List<PipelineAggregatorBuilder> orderedpipelineAggregators = null;
|
||||
List<PipelineAggregationBuilder> orderedpipelineAggregators = null;
|
||||
if (skipResolveOrder) {
|
||||
orderedpipelineAggregators = new ArrayList<>(pipelineAggregatorBuilders);
|
||||
} else {
|
||||
|
@ -213,21 +213,21 @@ public class AggregatorFactories {
|
|||
return new AggregatorFactories(parent, aggFactories, orderedpipelineAggregators);
|
||||
}
|
||||
|
||||
private List<PipelineAggregatorBuilder> resolvePipelineAggregatorOrder(
|
||||
List<PipelineAggregatorBuilder> pipelineAggregatorBuilders, List<AggregationBuilder> aggBuilders) {
|
||||
Map<String, PipelineAggregatorBuilder> pipelineAggregatorBuildersMap = new HashMap<>();
|
||||
for (PipelineAggregatorBuilder builder : pipelineAggregatorBuilders) {
|
||||
private List<PipelineAggregationBuilder> resolvePipelineAggregatorOrder(
|
||||
List<PipelineAggregationBuilder> pipelineAggregatorBuilders, List<AggregationBuilder> aggBuilders) {
|
||||
Map<String, PipelineAggregationBuilder> pipelineAggregatorBuildersMap = new HashMap<>();
|
||||
for (PipelineAggregationBuilder builder : pipelineAggregatorBuilders) {
|
||||
pipelineAggregatorBuildersMap.put(builder.getName(), builder);
|
||||
}
|
||||
Map<String, AggregationBuilder> aggBuildersMap = new HashMap<>();
|
||||
for (AggregationBuilder aggBuilder : aggBuilders) {
|
||||
aggBuildersMap.put(aggBuilder.name, aggBuilder);
|
||||
}
|
||||
List<PipelineAggregatorBuilder> orderedPipelineAggregatorrs = new LinkedList<>();
|
||||
List<PipelineAggregatorBuilder> unmarkedBuilders = new ArrayList<PipelineAggregatorBuilder>(pipelineAggregatorBuilders);
|
||||
Set<PipelineAggregatorBuilder> temporarilyMarked = new HashSet<PipelineAggregatorBuilder>();
|
||||
List<PipelineAggregationBuilder> orderedPipelineAggregatorrs = new LinkedList<>();
|
||||
List<PipelineAggregationBuilder> unmarkedBuilders = new ArrayList<PipelineAggregationBuilder>(pipelineAggregatorBuilders);
|
||||
Set<PipelineAggregationBuilder> temporarilyMarked = new HashSet<PipelineAggregationBuilder>();
|
||||
while (!unmarkedBuilders.isEmpty()) {
|
||||
PipelineAggregatorBuilder builder = unmarkedBuilders.get(0);
|
||||
PipelineAggregationBuilder builder = unmarkedBuilders.get(0);
|
||||
resolvePipelineAggregatorOrder(aggBuildersMap, pipelineAggregatorBuildersMap, orderedPipelineAggregatorrs, unmarkedBuilders,
|
||||
temporarilyMarked, builder);
|
||||
}
|
||||
|
@ -235,9 +235,9 @@ public class AggregatorFactories {
|
|||
}
|
||||
|
||||
private void resolvePipelineAggregatorOrder(Map<String, AggregationBuilder> aggBuildersMap,
|
||||
Map<String, PipelineAggregatorBuilder> pipelineAggregatorBuildersMap,
|
||||
List<PipelineAggregatorBuilder> orderedPipelineAggregators, List<PipelineAggregatorBuilder> unmarkedBuilders,
|
||||
Set<PipelineAggregatorBuilder> temporarilyMarked, PipelineAggregatorBuilder builder) {
|
||||
Map<String, PipelineAggregationBuilder> pipelineAggregatorBuildersMap,
|
||||
List<PipelineAggregationBuilder> orderedPipelineAggregators, List<PipelineAggregationBuilder> unmarkedBuilders,
|
||||
Set<PipelineAggregationBuilder> temporarilyMarked, PipelineAggregationBuilder builder) {
|
||||
if (temporarilyMarked.contains(builder)) {
|
||||
throw new IllegalArgumentException("Cyclical dependency found with pipeline aggregator [" + builder.getName() + "]");
|
||||
} else if (unmarkedBuilders.contains(builder)) {
|
||||
|
@ -269,8 +269,8 @@ public class AggregatorFactories {
|
|||
}
|
||||
// Check the pipeline sub-aggregator factories
|
||||
if (!foundSubBuilder && (i == bucketsPathElements.size() - 1)) {
|
||||
List<PipelineAggregatorBuilder> subPipelineBuilders = aggBuilder.factoriesBuilder.pipelineAggregatorBuilders;
|
||||
for (PipelineAggregatorBuilder subFactory : subPipelineBuilders) {
|
||||
List<PipelineAggregationBuilder> subPipelineBuilders = aggBuilder.factoriesBuilder.pipelineAggregatorBuilders;
|
||||
for (PipelineAggregationBuilder subFactory : subPipelineBuilders) {
|
||||
if (aggName.equals(subFactory.getName())) {
|
||||
foundSubBuilder = true;
|
||||
break;
|
||||
|
@ -285,7 +285,7 @@ public class AggregatorFactories {
|
|||
}
|
||||
continue;
|
||||
} else {
|
||||
PipelineAggregatorBuilder matchingBuilder = pipelineAggregatorBuildersMap.get(firstAggName);
|
||||
PipelineAggregationBuilder matchingBuilder = pipelineAggregatorBuildersMap.get(firstAggName);
|
||||
if (matchingBuilder != null) {
|
||||
resolvePipelineAggregatorOrder(aggBuildersMap, pipelineAggregatorBuildersMap, orderedPipelineAggregators,
|
||||
unmarkedBuilders, temporarilyMarked, matchingBuilder);
|
||||
|
@ -304,7 +304,7 @@ public class AggregatorFactories {
|
|||
return this.aggregationBuilders.toArray(new AggregationBuilder[this.aggregationBuilders.size()]);
|
||||
}
|
||||
|
||||
List<PipelineAggregatorBuilder> getPipelineAggregatorFactories() {
|
||||
List<PipelineAggregationBuilder> getPipelineAggregatorFactories() {
|
||||
return this.pipelineAggregatorBuilders;
|
||||
}
|
||||
|
||||
|
@ -321,7 +321,7 @@ public class AggregatorFactories {
|
|||
}
|
||||
}
|
||||
if (pipelineAggregatorBuilders != null) {
|
||||
for (PipelineAggregatorBuilder subAgg : pipelineAggregatorBuilders) {
|
||||
for (PipelineAggregationBuilder subAgg : pipelineAggregatorBuilders) {
|
||||
subAgg.toXContent(builder, params);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ public class AggregatorParsers {
|
|||
}
|
||||
|
||||
AggregationBuilder aggFactory = null;
|
||||
PipelineAggregatorBuilder pipelineAggregatorFactory = null;
|
||||
PipelineAggregationBuilder pipelineAggregatorFactory = null;
|
||||
AggregatorFactories.Builder subFactories = null;
|
||||
|
||||
Map<String, Object> metaData = null;
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.Map;
|
|||
* A factory that knows how to create an {@link PipelineAggregator} of a
|
||||
* specific type.
|
||||
*/
|
||||
public abstract class PipelineAggregatorBuilder extends ToXContentToBytes
|
||||
public abstract class PipelineAggregationBuilder extends ToXContentToBytes
|
||||
implements NamedWriteable {
|
||||
|
||||
protected final String name;
|
||||
|
@ -43,7 +43,7 @@ public abstract class PipelineAggregatorBuilder extends ToXContentToBytes
|
|||
* @param name
|
||||
* The aggregation name
|
||||
*/
|
||||
protected PipelineAggregatorBuilder(String name, String[] bucketsPaths) {
|
||||
protected PipelineAggregationBuilder(String name, String[] bucketsPaths) {
|
||||
if (name == null) {
|
||||
throw new IllegalArgumentException("[name] must not be null: [" + name + "]");
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public abstract class PipelineAggregatorBuilder extends ToXContentToBytes
|
|||
* configured)
|
||||
*/
|
||||
protected abstract void validate(AggregatorFactory<?> parent, AggregatorFactory<?>[] factories,
|
||||
List<PipelineAggregatorBuilder> pipelineAggregatorFactories);
|
||||
List<PipelineAggregationBuilder> pipelineAggregatorFactories);
|
||||
|
||||
/**
|
||||
* Creates the pipeline aggregator
|
||||
|
@ -78,7 +78,7 @@ public abstract class PipelineAggregatorBuilder extends ToXContentToBytes
|
|||
*/
|
||||
protected abstract PipelineAggregator create() throws IOException;
|
||||
|
||||
/** Associate metadata with this {@link PipelineAggregatorBuilder}. */
|
||||
public abstract PipelineAggregatorBuilder setMetaData(Map<String, Object> metaData);
|
||||
/** Associate metadata with this {@link PipelineAggregationBuilder}. */
|
||||
public abstract PipelineAggregationBuilder setMetaData(Map<String, Object> metaData);
|
||||
|
||||
}
|
|
@ -23,7 +23,7 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
|||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.search.aggregations.AggregatorFactory;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregationBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
@ -32,10 +32,10 @@ import java.util.Map;
|
|||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Base implementation of a {@link PipelineAggregatorBuilder}.
|
||||
* Base implementation of a {@link PipelineAggregationBuilder}.
|
||||
*/
|
||||
public abstract class AbstractPipelineAggregatorBuilder<PAB extends AbstractPipelineAggregatorBuilder<PAB>>
|
||||
extends PipelineAggregatorBuilder {
|
||||
public abstract class AbstractPipelineAggregationBuilder<PAB extends AbstractPipelineAggregationBuilder<PAB>>
|
||||
extends PipelineAggregationBuilder {
|
||||
|
||||
/**
|
||||
* Field shared by many parsers.
|
||||
|
@ -45,7 +45,7 @@ public abstract class AbstractPipelineAggregatorBuilder<PAB extends AbstractPipe
|
|||
protected final String type;
|
||||
protected Map<String, Object> metaData;
|
||||
|
||||
protected AbstractPipelineAggregatorBuilder(String name, String type, String[] bucketsPaths) {
|
||||
protected AbstractPipelineAggregationBuilder(String name, String type, String[] bucketsPaths) {
|
||||
super(name, bucketsPaths);
|
||||
if (type == null) {
|
||||
throw new IllegalArgumentException("[type] must not be null: [" + name + "]");
|
||||
|
@ -56,7 +56,7 @@ public abstract class AbstractPipelineAggregatorBuilder<PAB extends AbstractPipe
|
|||
/**
|
||||
* Read from a stream.
|
||||
*/
|
||||
protected AbstractPipelineAggregatorBuilder(StreamInput in, String type) throws IOException {
|
||||
protected AbstractPipelineAggregationBuilder(StreamInput in, String type) throws IOException {
|
||||
this(in.readString(), type, in.readStringArray());
|
||||
metaData = in.readMap();
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ public abstract class AbstractPipelineAggregatorBuilder<PAB extends AbstractPipe
|
|||
*/
|
||||
@Override
|
||||
public final void validate(AggregatorFactory<?> parent, AggregatorFactory<?>[] factories,
|
||||
List<PipelineAggregatorBuilder> pipelineAggregatorFactories) {
|
||||
List<PipelineAggregationBuilder> pipelineAggregatorFactories) {
|
||||
doValidate(parent, factories, pipelineAggregatorFactories);
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ public abstract class AbstractPipelineAggregatorBuilder<PAB extends AbstractPipe
|
|||
}
|
||||
|
||||
public void doValidate(AggregatorFactory<?> parent, AggregatorFactory<?>[] factories,
|
||||
List<PipelineAggregatorBuilder> pipelineAggregatorFactories) {
|
||||
List<PipelineAggregationBuilder> pipelineAggregatorFactories) {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
@ -134,7 +134,7 @@ public abstract class AbstractPipelineAggregatorBuilder<PAB extends AbstractPipe
|
|||
}
|
||||
|
||||
/**
|
||||
* @return <code>true</code> if the {@link AbstractPipelineAggregatorBuilder}
|
||||
* @return <code>true</code> if the {@link AbstractPipelineAggregationBuilder}
|
||||
* overrides the XContent rendering of the bucketPath option.
|
||||
*/
|
||||
protected boolean overrideBucketsPath() {
|
||||
|
@ -157,7 +157,7 @@ public abstract class AbstractPipelineAggregatorBuilder<PAB extends AbstractPipe
|
|||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
@SuppressWarnings("unchecked")
|
||||
AbstractPipelineAggregatorBuilder<PAB> other = (AbstractPipelineAggregatorBuilder<PAB>) obj;
|
||||
AbstractPipelineAggregationBuilder<PAB> other = (AbstractPipelineAggregationBuilder<PAB>) obj;
|
||||
if (!Objects.equals(name, other.name))
|
||||
return false;
|
||||
if (!Objects.equals(type, other.type))
|
|
@ -156,7 +156,7 @@ public class BucketHelpers {
|
|||
try {
|
||||
Object propertyValue = bucket.getProperty(agg.getName(), aggPathAsList);
|
||||
if (propertyValue == null) {
|
||||
throw new AggregationExecutionException(AbstractPipelineAggregatorBuilder.BUCKETS_PATH_FIELD.getPreferredName()
|
||||
throw new AggregationExecutionException(AbstractPipelineAggregationBuilder.BUCKETS_PATH_FIELD.getPreferredName()
|
||||
+ " must reference either a number value or a single value numeric metric aggregation");
|
||||
} else {
|
||||
double value;
|
||||
|
@ -165,7 +165,7 @@ public class BucketHelpers {
|
|||
} else if (propertyValue instanceof InternalNumericMetricsAggregation.SingleValue) {
|
||||
value = ((InternalNumericMetricsAggregation.SingleValue) propertyValue).value();
|
||||
} else {
|
||||
throw new AggregationExecutionException(AbstractPipelineAggregatorBuilder.BUCKETS_PATH_FIELD.getPreferredName()
|
||||
throw new AggregationExecutionException(AbstractPipelineAggregationBuilder.BUCKETS_PATH_FIELD.getPreferredName()
|
||||
+ " must reference either a number value or a single value numeric metric aggregation, got: "
|
||||
+ propertyValue.getClass().getCanonicalName());
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.index.query.QueryParseContext;
|
|||
import org.elasticsearch.search.aggregations.InternalAggregation;
|
||||
import org.elasticsearch.search.aggregations.InternalAggregation.ReduceContext;
|
||||
import org.elasticsearch.search.aggregations.InternalAggregation.Type;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregationBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
@ -36,7 +36,7 @@ import java.util.Map;
|
|||
public abstract class PipelineAggregator implements Streamable {
|
||||
|
||||
/**
|
||||
* Parse the {@link PipelineAggregatorBuilder} from a {@link QueryParseContext}.
|
||||
* Parse the {@link PipelineAggregationBuilder} from a {@link QueryParseContext}.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public static interface Parser {
|
||||
|
@ -56,7 +56,7 @@ public abstract class PipelineAggregator implements Streamable {
|
|||
* @throws java.io.IOException
|
||||
* When parsing fails
|
||||
*/
|
||||
PipelineAggregatorBuilder parse(String pipelineAggregatorName, QueryParseContext context)
|
||||
PipelineAggregationBuilder parse(String pipelineAggregatorName, QueryParseContext context)
|
||||
throws IOException;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,19 +20,19 @@
|
|||
package org.elasticsearch.search.aggregations.pipeline;
|
||||
|
||||
import org.elasticsearch.script.Script;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.avg.AvgBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.max.MaxBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.min.MinBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.percentile.PercentilesBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.StatsBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.extended.ExtendedStatsBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.sum.SumBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketscript.BucketScriptPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketselector.BucketSelectorPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.cumulativesum.CumulativeSumPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.derivative.DerivativePipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.serialdiff.SerialDiffPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.avg.AvgBucketPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.max.MaxBucketPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.min.MinBucketPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.percentile.PercentilesBucketPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.StatsBucketPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.extended.ExtendedStatsBucketPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.sum.SumBucketPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketscript.BucketScriptPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketselector.BucketSelectorPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.cumulativesum.CumulativeSumPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.derivative.DerivativePipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.serialdiff.SerialDiffPipelineAggregationBuilder;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -41,70 +41,70 @@ public final class PipelineAggregatorBuilders {
|
|||
private PipelineAggregatorBuilders() {
|
||||
}
|
||||
|
||||
public static final DerivativePipelineAggregatorBuilder derivative(String name, String bucketsPath) {
|
||||
return new DerivativePipelineAggregatorBuilder(name, bucketsPath);
|
||||
public static final DerivativePipelineAggregationBuilder derivative(String name, String bucketsPath) {
|
||||
return new DerivativePipelineAggregationBuilder(name, bucketsPath);
|
||||
}
|
||||
|
||||
public static final MaxBucketPipelineAggregatorBuilder maxBucket(String name, String bucketsPath) {
|
||||
return new MaxBucketPipelineAggregatorBuilder(name, bucketsPath);
|
||||
public static final MaxBucketPipelineAggregationBuilder maxBucket(String name, String bucketsPath) {
|
||||
return new MaxBucketPipelineAggregationBuilder(name, bucketsPath);
|
||||
}
|
||||
|
||||
public static final MinBucketPipelineAggregatorBuilder minBucket(String name, String bucketsPath) {
|
||||
return new MinBucketPipelineAggregatorBuilder(name, bucketsPath);
|
||||
public static final MinBucketPipelineAggregationBuilder minBucket(String name, String bucketsPath) {
|
||||
return new MinBucketPipelineAggregationBuilder(name, bucketsPath);
|
||||
}
|
||||
|
||||
public static final AvgBucketPipelineAggregatorBuilder avgBucket(String name, String bucketsPath) {
|
||||
return new AvgBucketPipelineAggregatorBuilder(name, bucketsPath);
|
||||
public static final AvgBucketPipelineAggregationBuilder avgBucket(String name, String bucketsPath) {
|
||||
return new AvgBucketPipelineAggregationBuilder(name, bucketsPath);
|
||||
}
|
||||
|
||||
public static final SumBucketPipelineAggregatorBuilder sumBucket(String name, String bucketsPath) {
|
||||
return new SumBucketPipelineAggregatorBuilder(name, bucketsPath);
|
||||
public static final SumBucketPipelineAggregationBuilder sumBucket(String name, String bucketsPath) {
|
||||
return new SumBucketPipelineAggregationBuilder(name, bucketsPath);
|
||||
}
|
||||
|
||||
public static final StatsBucketPipelineAggregatorBuilder statsBucket(String name, String bucketsPath) {
|
||||
return new StatsBucketPipelineAggregatorBuilder(name, bucketsPath);
|
||||
public static final StatsBucketPipelineAggregationBuilder statsBucket(String name, String bucketsPath) {
|
||||
return new StatsBucketPipelineAggregationBuilder(name, bucketsPath);
|
||||
}
|
||||
|
||||
public static final ExtendedStatsBucketPipelineAggregatorBuilder extendedStatsBucket(String name,
|
||||
public static final ExtendedStatsBucketPipelineAggregationBuilder extendedStatsBucket(String name,
|
||||
String bucketsPath) {
|
||||
return new ExtendedStatsBucketPipelineAggregatorBuilder(name, bucketsPath);
|
||||
return new ExtendedStatsBucketPipelineAggregationBuilder(name, bucketsPath);
|
||||
}
|
||||
|
||||
public static final PercentilesBucketPipelineAggregatorBuilder percentilesBucket(String name,
|
||||
public static final PercentilesBucketPipelineAggregationBuilder percentilesBucket(String name,
|
||||
String bucketsPath) {
|
||||
return new PercentilesBucketPipelineAggregatorBuilder(name, bucketsPath);
|
||||
return new PercentilesBucketPipelineAggregationBuilder(name, bucketsPath);
|
||||
}
|
||||
|
||||
public static final MovAvgPipelineAggregatorBuilder movingAvg(String name, String bucketsPath) {
|
||||
return new MovAvgPipelineAggregatorBuilder(name, bucketsPath);
|
||||
public static final MovAvgPipelineAggregationBuilder movingAvg(String name, String bucketsPath) {
|
||||
return new MovAvgPipelineAggregationBuilder(name, bucketsPath);
|
||||
}
|
||||
|
||||
public static final BucketScriptPipelineAggregatorBuilder bucketScript(String name,
|
||||
public static final BucketScriptPipelineAggregationBuilder bucketScript(String name,
|
||||
Map<String, String> bucketsPathsMap, Script script) {
|
||||
return new BucketScriptPipelineAggregatorBuilder(name, bucketsPathsMap, script);
|
||||
return new BucketScriptPipelineAggregationBuilder(name, bucketsPathsMap, script);
|
||||
}
|
||||
|
||||
public static final BucketScriptPipelineAggregatorBuilder bucketScript(String name, Script script,
|
||||
public static final BucketScriptPipelineAggregationBuilder bucketScript(String name, Script script,
|
||||
String... bucketsPaths) {
|
||||
return new BucketScriptPipelineAggregatorBuilder(name, script, bucketsPaths);
|
||||
return new BucketScriptPipelineAggregationBuilder(name, script, bucketsPaths);
|
||||
}
|
||||
|
||||
public static final BucketSelectorPipelineAggregatorBuilder bucketSelector(String name,
|
||||
public static final BucketSelectorPipelineAggregationBuilder bucketSelector(String name,
|
||||
Map<String, String> bucketsPathsMap, Script script) {
|
||||
return new BucketSelectorPipelineAggregatorBuilder(name, bucketsPathsMap, script);
|
||||
return new BucketSelectorPipelineAggregationBuilder(name, bucketsPathsMap, script);
|
||||
}
|
||||
|
||||
public static final BucketSelectorPipelineAggregatorBuilder bucketSelector(String name, Script script,
|
||||
public static final BucketSelectorPipelineAggregationBuilder bucketSelector(String name, Script script,
|
||||
String... bucketsPaths) {
|
||||
return new BucketSelectorPipelineAggregatorBuilder(name, script, bucketsPaths);
|
||||
return new BucketSelectorPipelineAggregationBuilder(name, script, bucketsPaths);
|
||||
}
|
||||
|
||||
public static final CumulativeSumPipelineAggregatorBuilder cumulativeSum(String name,
|
||||
public static final CumulativeSumPipelineAggregationBuilder cumulativeSum(String name,
|
||||
String bucketsPath) {
|
||||
return new CumulativeSumPipelineAggregatorBuilder(name, bucketsPath);
|
||||
return new CumulativeSumPipelineAggregationBuilder(name, bucketsPath);
|
||||
}
|
||||
|
||||
public static final SerialDiffPipelineAggregatorBuilder diff(String name, String bucketsPath) {
|
||||
return new SerialDiffPipelineAggregatorBuilder(name, bucketsPath);
|
||||
public static final SerialDiffPipelineAggregationBuilder diff(String name, String bucketsPath) {
|
||||
return new SerialDiffPipelineAggregationBuilder(name, bucketsPath);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ public abstract class BucketMetricsParser implements PipelineAggregator.Parser {
|
|||
}
|
||||
|
||||
@Override
|
||||
public final BucketMetricsPipelineAggregatorBuilder<?> parse(String pipelineAggregatorName, QueryParseContext context)
|
||||
public final BucketMetricsPipelineAggregationBuilder<?> parse(String pipelineAggregatorName, QueryParseContext context)
|
||||
throws IOException {
|
||||
XContentParser parser = context.parser();
|
||||
XContentParser.Token token;
|
||||
|
@ -88,7 +88,7 @@ public abstract class BucketMetricsParser implements PipelineAggregator.Parser {
|
|||
"Missing required field [" + BUCKETS_PATH.getPreferredName() + "] for aggregation [" + pipelineAggregatorName + "]");
|
||||
}
|
||||
|
||||
BucketMetricsPipelineAggregatorBuilder<?> factory = buildFactory(pipelineAggregatorName, bucketsPaths[0], params);
|
||||
BucketMetricsPipelineAggregationBuilder<?> factory = buildFactory(pipelineAggregatorName, bucketsPaths[0], params);
|
||||
if (format != null) {
|
||||
factory.format(format);
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ public abstract class BucketMetricsParser implements PipelineAggregator.Parser {
|
|||
return factory;
|
||||
}
|
||||
|
||||
protected abstract BucketMetricsPipelineAggregatorBuilder<?> buildFactory(String pipelineAggregatorName, String bucketsPaths,
|
||||
protected abstract BucketMetricsPipelineAggregationBuilder<?> buildFactory(String pipelineAggregatorName, String bucketsPaths,
|
||||
Map<String, Object> params);
|
||||
|
||||
protected boolean token(XContentParser parser, QueryParseContext context, String field,
|
||||
|
|
|
@ -24,9 +24,9 @@ import org.elasticsearch.common.io.stream.StreamOutput;
|
|||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.search.DocValueFormat;
|
||||
import org.elasticsearch.search.aggregations.AggregatorFactory;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy;
|
||||
import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -34,20 +34,20 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public abstract class BucketMetricsPipelineAggregatorBuilder<AF extends BucketMetricsPipelineAggregatorBuilder<AF>>
|
||||
extends AbstractPipelineAggregatorBuilder<AF> {
|
||||
public abstract class BucketMetricsPipelineAggregationBuilder<AF extends BucketMetricsPipelineAggregationBuilder<AF>>
|
||||
extends AbstractPipelineAggregationBuilder<AF> {
|
||||
|
||||
private String format = null;
|
||||
private GapPolicy gapPolicy = GapPolicy.SKIP;
|
||||
|
||||
protected BucketMetricsPipelineAggregatorBuilder(String name, String type, String[] bucketsPaths) {
|
||||
protected BucketMetricsPipelineAggregationBuilder(String name, String type, String[] bucketsPaths) {
|
||||
super(name, type, bucketsPaths);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read from a stream.
|
||||
*/
|
||||
protected BucketMetricsPipelineAggregatorBuilder(StreamInput in, String type) throws IOException {
|
||||
protected BucketMetricsPipelineAggregationBuilder(StreamInput in, String type) throws IOException {
|
||||
super(in, type);
|
||||
format = in.readOptionalString();
|
||||
gapPolicy = GapPolicy.readFrom(in);
|
||||
|
@ -107,7 +107,7 @@ public abstract class BucketMetricsPipelineAggregatorBuilder<AF extends BucketMe
|
|||
|
||||
@Override
|
||||
public void doValidate(AggregatorFactory<?> parent, AggregatorFactory<?>[] aggFactories,
|
||||
List<PipelineAggregatorBuilder> pipelineAggregatorFactories) {
|
||||
List<PipelineAggregationBuilder> pipelineAggregatorFactories) {
|
||||
if (bucketsPaths.length != 1) {
|
||||
throw new IllegalStateException(PipelineAggregator.Parser.BUCKETS_PATH.getPreferredName()
|
||||
+ " must contain a single entry for aggregation [" + name + "]");
|
||||
|
@ -138,12 +138,12 @@ public abstract class BucketMetricsPipelineAggregatorBuilder<AF extends BucketMe
|
|||
@Override
|
||||
protected final boolean doEquals(Object obj) {
|
||||
@SuppressWarnings("unchecked")
|
||||
BucketMetricsPipelineAggregatorBuilder<AF> other = (BucketMetricsPipelineAggregatorBuilder<AF>) obj;
|
||||
BucketMetricsPipelineAggregationBuilder<AF> other = (BucketMetricsPipelineAggregationBuilder<AF>) obj;
|
||||
return Objects.equals(format, other.format)
|
||||
&& Objects.equals(gapPolicy, other.gapPolicy)
|
||||
&& innerEquals(other);
|
||||
}
|
||||
|
||||
protected abstract boolean innerEquals(BucketMetricsPipelineAggregatorBuilder<AF> other);
|
||||
protected abstract boolean innerEquals(BucketMetricsPipelineAggregationBuilder<AF> other);
|
||||
|
||||
}
|
|
@ -24,27 +24,27 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
|||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.search.aggregations.AggregatorFactory;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsParser;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsPipelineAggregationBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AvgBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAggregatorBuilder<AvgBucketPipelineAggregatorBuilder> {
|
||||
public class AvgBucketPipelineAggregationBuilder extends BucketMetricsPipelineAggregationBuilder<AvgBucketPipelineAggregationBuilder> {
|
||||
public static final String NAME = AvgBucketPipelineAggregator.TYPE.name();
|
||||
public static final ParseField AGGREGATION_NAME_FIELD = new ParseField(NAME);
|
||||
|
||||
public AvgBucketPipelineAggregatorBuilder(String name, String bucketsPath) {
|
||||
public AvgBucketPipelineAggregationBuilder(String name, String bucketsPath) {
|
||||
super(name, AvgBucketPipelineAggregator.TYPE.name(), new String[] { bucketsPath });
|
||||
}
|
||||
|
||||
/**
|
||||
* Read from a stream.
|
||||
*/
|
||||
public AvgBucketPipelineAggregatorBuilder(StreamInput in) throws IOException {
|
||||
public AvgBucketPipelineAggregationBuilder(StreamInput in) throws IOException {
|
||||
super(in, NAME);
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ public class AvgBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAgg
|
|||
|
||||
@Override
|
||||
public void doValidate(AggregatorFactory<?> parent, AggregatorFactory<?>[] aggFactories,
|
||||
List<PipelineAggregatorBuilder> pipelineAggregatorFactories) {
|
||||
List<PipelineAggregationBuilder> pipelineAggregatorFactories) {
|
||||
if (bucketsPaths.length != 1) {
|
||||
throw new IllegalStateException(PipelineAggregator.Parser.BUCKETS_PATH.getPreferredName()
|
||||
+ " must contain a single entry for aggregation [" + name + "]");
|
||||
|
@ -74,9 +74,9 @@ public class AvgBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAgg
|
|||
|
||||
public static final PipelineAggregator.Parser PARSER = new BucketMetricsParser() {
|
||||
@Override
|
||||
protected AvgBucketPipelineAggregatorBuilder buildFactory(String pipelineAggregatorName,
|
||||
protected AvgBucketPipelineAggregationBuilder buildFactory(String pipelineAggregatorName,
|
||||
String bucketsPath, Map<String, Object> params) {
|
||||
return new AvgBucketPipelineAggregatorBuilder(pipelineAggregatorName, bucketsPath);
|
||||
return new AvgBucketPipelineAggregationBuilder(pipelineAggregatorName, bucketsPath);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -86,7 +86,7 @@ public class AvgBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAgg
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean innerEquals(BucketMetricsPipelineAggregatorBuilder<AvgBucketPipelineAggregatorBuilder> other) {
|
||||
protected boolean innerEquals(BucketMetricsPipelineAggregationBuilder<AvgBucketPipelineAggregationBuilder> other) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -24,27 +24,27 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
|||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.search.aggregations.AggregatorFactory;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsParser;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsPipelineAggregationBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class MaxBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAggregatorBuilder<MaxBucketPipelineAggregatorBuilder> {
|
||||
public class MaxBucketPipelineAggregationBuilder extends BucketMetricsPipelineAggregationBuilder<MaxBucketPipelineAggregationBuilder> {
|
||||
public static final String NAME = MaxBucketPipelineAggregator.TYPE.name();
|
||||
public static final ParseField AGGREGATION_NAME_FIELD = new ParseField(NAME);
|
||||
|
||||
public MaxBucketPipelineAggregatorBuilder(String name, String bucketsPath) {
|
||||
public MaxBucketPipelineAggregationBuilder(String name, String bucketsPath) {
|
||||
super(name, MaxBucketPipelineAggregator.TYPE.name(), new String[] { bucketsPath });
|
||||
}
|
||||
|
||||
/**
|
||||
* Read from a stream.
|
||||
*/
|
||||
public MaxBucketPipelineAggregatorBuilder(StreamInput in) throws IOException {
|
||||
public MaxBucketPipelineAggregationBuilder(StreamInput in) throws IOException {
|
||||
super(in, NAME);
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ public class MaxBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAgg
|
|||
|
||||
@Override
|
||||
public void doValidate(AggregatorFactory<?> parent, AggregatorFactory<?>[] aggFactories,
|
||||
List<PipelineAggregatorBuilder> pipelineAggregatorFactories) {
|
||||
List<PipelineAggregationBuilder> pipelineAggregatorFactories) {
|
||||
if (bucketsPaths.length != 1) {
|
||||
throw new IllegalStateException(PipelineAggregator.Parser.BUCKETS_PATH.getPreferredName()
|
||||
+ " must contain a single entry for aggregation [" + name + "]");
|
||||
|
@ -74,9 +74,9 @@ public class MaxBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAgg
|
|||
|
||||
public static final PipelineAggregator.Parser PARSER = new BucketMetricsParser() {
|
||||
@Override
|
||||
protected MaxBucketPipelineAggregatorBuilder buildFactory(String pipelineAggregatorName,
|
||||
protected MaxBucketPipelineAggregationBuilder buildFactory(String pipelineAggregatorName,
|
||||
String bucketsPath, Map<String, Object> params) {
|
||||
return new MaxBucketPipelineAggregatorBuilder(pipelineAggregatorName, bucketsPath);
|
||||
return new MaxBucketPipelineAggregationBuilder(pipelineAggregatorName, bucketsPath);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -86,7 +86,7 @@ public class MaxBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAgg
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean innerEquals(BucketMetricsPipelineAggregatorBuilder<MaxBucketPipelineAggregatorBuilder> other) {
|
||||
protected boolean innerEquals(BucketMetricsPipelineAggregationBuilder<MaxBucketPipelineAggregationBuilder> other) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -24,27 +24,27 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
|||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.search.aggregations.AggregatorFactory;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsParser;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsPipelineAggregationBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class MinBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAggregatorBuilder<MinBucketPipelineAggregatorBuilder> {
|
||||
public class MinBucketPipelineAggregationBuilder extends BucketMetricsPipelineAggregationBuilder<MinBucketPipelineAggregationBuilder> {
|
||||
public static final String NAME = MinBucketPipelineAggregator.TYPE.name();
|
||||
public static final ParseField AGGREGATION_FIELD_NAME = new ParseField(NAME);
|
||||
|
||||
public MinBucketPipelineAggregatorBuilder(String name, String bucketsPath) {
|
||||
public MinBucketPipelineAggregationBuilder(String name, String bucketsPath) {
|
||||
super(name, MinBucketPipelineAggregator.TYPE.name(), new String[] { bucketsPath });
|
||||
}
|
||||
|
||||
/**
|
||||
* Read from a stream.
|
||||
*/
|
||||
public MinBucketPipelineAggregatorBuilder(StreamInput in) throws IOException {
|
||||
public MinBucketPipelineAggregationBuilder(StreamInput in) throws IOException {
|
||||
super(in, NAME);
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ public class MinBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAgg
|
|||
|
||||
@Override
|
||||
public void doValidate(AggregatorFactory<?> parent, AggregatorFactory<?>[] aggFactories,
|
||||
List<PipelineAggregatorBuilder> pipelineAggregatorFactories) {
|
||||
List<PipelineAggregationBuilder> pipelineAggregatorFactories) {
|
||||
if (bucketsPaths.length != 1) {
|
||||
throw new IllegalStateException(PipelineAggregator.Parser.BUCKETS_PATH.getPreferredName()
|
||||
+ " must contain a single entry for aggregation [" + name + "]");
|
||||
|
@ -74,9 +74,9 @@ public class MinBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAgg
|
|||
|
||||
public static final PipelineAggregator.Parser PARSER = new BucketMetricsParser() {
|
||||
@Override
|
||||
protected MinBucketPipelineAggregatorBuilder buildFactory(String pipelineAggregatorName,
|
||||
protected MinBucketPipelineAggregationBuilder buildFactory(String pipelineAggregatorName,
|
||||
String bucketsPath, Map<String, Object> params) {
|
||||
return new MinBucketPipelineAggregatorBuilder(pipelineAggregatorName, bucketsPath);
|
||||
return new MinBucketPipelineAggregationBuilder(pipelineAggregatorName, bucketsPath);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -86,7 +86,7 @@ public class MinBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAgg
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean innerEquals(BucketMetricsPipelineAggregatorBuilder<MinBucketPipelineAggregatorBuilder> other) {
|
||||
protected boolean innerEquals(BucketMetricsPipelineAggregationBuilder<MinBucketPipelineAggregationBuilder> other) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -27,10 +27,10 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
|
|||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.index.query.QueryParseContext;
|
||||
import org.elasticsearch.search.aggregations.AggregatorFactory;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsParser;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsPipelineAggregationBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
@ -38,8 +38,8 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class PercentilesBucketPipelineAggregatorBuilder
|
||||
extends BucketMetricsPipelineAggregatorBuilder<PercentilesBucketPipelineAggregatorBuilder> {
|
||||
public class PercentilesBucketPipelineAggregationBuilder
|
||||
extends BucketMetricsPipelineAggregationBuilder<PercentilesBucketPipelineAggregationBuilder> {
|
||||
public static final String NAME = PercentilesBucketPipelineAggregator.TYPE.name();
|
||||
public static final ParseField AGGREGATION_NAME_FIELD = new ParseField(NAME);
|
||||
|
||||
|
@ -47,14 +47,14 @@ public class PercentilesBucketPipelineAggregatorBuilder
|
|||
|
||||
private double[] percents = new double[] { 1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0 };
|
||||
|
||||
public PercentilesBucketPipelineAggregatorBuilder(String name, String bucketsPath) {
|
||||
public PercentilesBucketPipelineAggregationBuilder(String name, String bucketsPath) {
|
||||
super(name, PercentilesBucketPipelineAggregator.TYPE.name(), new String[] { bucketsPath });
|
||||
}
|
||||
|
||||
/**
|
||||
* Read from a stream.
|
||||
*/
|
||||
public PercentilesBucketPipelineAggregatorBuilder(StreamInput in)
|
||||
public PercentilesBucketPipelineAggregationBuilder(StreamInput in)
|
||||
throws IOException {
|
||||
super(in, NAME);
|
||||
percents = in.readDoubleArray();
|
||||
|
@ -75,7 +75,7 @@ public class PercentilesBucketPipelineAggregatorBuilder
|
|||
/**
|
||||
* Set the percentages to calculate percentiles for in this aggregation
|
||||
*/
|
||||
public PercentilesBucketPipelineAggregatorBuilder percents(double[] percents) {
|
||||
public PercentilesBucketPipelineAggregationBuilder percents(double[] percents) {
|
||||
if (percents == null) {
|
||||
throw new IllegalArgumentException("[percents] must not be null: [" + name + "]");
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ public class PercentilesBucketPipelineAggregatorBuilder
|
|||
|
||||
@Override
|
||||
public void doValidate(AggregatorFactory<?> parent, AggregatorFactory<?>[] aggFactories,
|
||||
List<PipelineAggregatorBuilder> pipelineAggregatorFactories) {
|
||||
List<PipelineAggregationBuilder> pipelineAggregatorFactories) {
|
||||
if (bucketsPaths.length != 1) {
|
||||
throw new IllegalStateException(PipelineAggregator.Parser.BUCKETS_PATH.getPreferredName()
|
||||
+ " must contain a single entry for aggregation [" + name + "]");
|
||||
|
@ -121,11 +121,11 @@ public class PercentilesBucketPipelineAggregatorBuilder
|
|||
public static final PipelineAggregator.Parser PARSER = new BucketMetricsParser() {
|
||||
|
||||
@Override
|
||||
protected PercentilesBucketPipelineAggregatorBuilder buildFactory(String pipelineAggregatorName,
|
||||
protected PercentilesBucketPipelineAggregationBuilder buildFactory(String pipelineAggregatorName,
|
||||
String bucketsPath, Map<String, Object> params) {
|
||||
|
||||
PercentilesBucketPipelineAggregatorBuilder factory = new
|
||||
PercentilesBucketPipelineAggregatorBuilder(pipelineAggregatorName, bucketsPath);
|
||||
PercentilesBucketPipelineAggregationBuilder factory = new
|
||||
PercentilesBucketPipelineAggregationBuilder(pipelineAggregatorName, bucketsPath);
|
||||
|
||||
double[] percents = (double[]) params.get(PERCENTS_FIELD.getPreferredName());
|
||||
if (percents != null) {
|
||||
|
@ -157,8 +157,8 @@ public class PercentilesBucketPipelineAggregatorBuilder
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean innerEquals(BucketMetricsPipelineAggregatorBuilder<PercentilesBucketPipelineAggregatorBuilder> obj) {
|
||||
PercentilesBucketPipelineAggregatorBuilder other = (PercentilesBucketPipelineAggregatorBuilder) obj;
|
||||
protected boolean innerEquals(BucketMetricsPipelineAggregationBuilder<PercentilesBucketPipelineAggregationBuilder> obj) {
|
||||
PercentilesBucketPipelineAggregationBuilder other = (PercentilesBucketPipelineAggregationBuilder) obj;
|
||||
return Objects.deepEquals(percents, other.percents);
|
||||
}
|
||||
|
|
@ -24,28 +24,28 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
|||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.search.aggregations.AggregatorFactory;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsParser;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsPipelineAggregationBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class StatsBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAggregatorBuilder<StatsBucketPipelineAggregatorBuilder> {
|
||||
public class StatsBucketPipelineAggregationBuilder extends BucketMetricsPipelineAggregationBuilder<StatsBucketPipelineAggregationBuilder> {
|
||||
public static final String NAME = StatsBucketPipelineAggregator.TYPE.name();
|
||||
public static final ParseField AGGREGATION_NAME_FIELD = new ParseField(NAME);
|
||||
|
||||
public StatsBucketPipelineAggregatorBuilder(String name, String bucketsPath) {
|
||||
public StatsBucketPipelineAggregationBuilder(String name, String bucketsPath) {
|
||||
super(name, StatsBucketPipelineAggregator.TYPE.name(), new String[] { bucketsPath });
|
||||
}
|
||||
|
||||
/**
|
||||
* Read from a stream.
|
||||
*/
|
||||
public StatsBucketPipelineAggregatorBuilder(StreamInput in)
|
||||
public StatsBucketPipelineAggregationBuilder(StreamInput in)
|
||||
throws IOException {
|
||||
super(in, StatsBucketPipelineAggregator.TYPE.name());
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ public class StatsBucketPipelineAggregatorBuilder extends BucketMetricsPipelineA
|
|||
|
||||
@Override
|
||||
public void doValidate(AggregatorFactory<?> parent, AggregatorFactory<?>[] aggFactories,
|
||||
List<PipelineAggregatorBuilder> pipelineAggregatorFactories) {
|
||||
List<PipelineAggregationBuilder> pipelineAggregatorFactories) {
|
||||
if (bucketsPaths.length != 1) {
|
||||
throw new IllegalStateException(Parser.BUCKETS_PATH.getPreferredName()
|
||||
+ " must contain a single entry for aggregation [" + name + "]");
|
||||
|
@ -76,9 +76,9 @@ public class StatsBucketPipelineAggregatorBuilder extends BucketMetricsPipelineA
|
|||
|
||||
public static final PipelineAggregator.Parser PARSER = new BucketMetricsParser() {
|
||||
@Override
|
||||
protected StatsBucketPipelineAggregatorBuilder buildFactory(String pipelineAggregatorName,
|
||||
protected StatsBucketPipelineAggregationBuilder buildFactory(String pipelineAggregatorName,
|
||||
String bucketsPath, Map<String, Object> params) {
|
||||
return new StatsBucketPipelineAggregatorBuilder(pipelineAggregatorName, bucketsPath);
|
||||
return new StatsBucketPipelineAggregationBuilder(pipelineAggregatorName, bucketsPath);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -88,7 +88,7 @@ public class StatsBucketPipelineAggregatorBuilder extends BucketMetricsPipelineA
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean innerEquals(BucketMetricsPipelineAggregatorBuilder<StatsBucketPipelineAggregatorBuilder> other) {
|
||||
protected boolean innerEquals(BucketMetricsPipelineAggregationBuilder<StatsBucketPipelineAggregationBuilder> other) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -31,10 +31,10 @@ public class ExtendedStatsBucketParser extends BucketMetricsParser {
|
|||
static final ParseField SIGMA = new ParseField("sigma");
|
||||
|
||||
@Override
|
||||
protected ExtendedStatsBucketPipelineAggregatorBuilder buildFactory(String pipelineAggregatorName,
|
||||
protected ExtendedStatsBucketPipelineAggregationBuilder buildFactory(String pipelineAggregatorName,
|
||||
String bucketsPath, Map<String, Object> params) {
|
||||
ExtendedStatsBucketPipelineAggregatorBuilder factory =
|
||||
new ExtendedStatsBucketPipelineAggregatorBuilder(pipelineAggregatorName, bucketsPath);
|
||||
ExtendedStatsBucketPipelineAggregationBuilder factory =
|
||||
new ExtendedStatsBucketPipelineAggregationBuilder(pipelineAggregatorName, bucketsPath);
|
||||
Double sigma = (Double) params.get(SIGMA.getPreferredName());
|
||||
if (sigma != null) {
|
||||
factory.sigma(sigma);
|
||||
|
|
|
@ -24,31 +24,31 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
|||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.search.aggregations.AggregatorFactory;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsPipelineAggregationBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class ExtendedStatsBucketPipelineAggregatorBuilder
|
||||
extends BucketMetricsPipelineAggregatorBuilder<ExtendedStatsBucketPipelineAggregatorBuilder> {
|
||||
public class ExtendedStatsBucketPipelineAggregationBuilder
|
||||
extends BucketMetricsPipelineAggregationBuilder<ExtendedStatsBucketPipelineAggregationBuilder> {
|
||||
public static final String NAME = ExtendedStatsBucketPipelineAggregator.TYPE.name();
|
||||
public static final ParseField AGGREGATION_NAME_FIELD = new ParseField(NAME);
|
||||
|
||||
private double sigma = 2.0;
|
||||
|
||||
public ExtendedStatsBucketPipelineAggregatorBuilder(String name, String bucketsPath) {
|
||||
public ExtendedStatsBucketPipelineAggregationBuilder(String name, String bucketsPath) {
|
||||
super(name, ExtendedStatsBucketPipelineAggregator.TYPE.name(), new String[] { bucketsPath });
|
||||
}
|
||||
|
||||
/**
|
||||
* Read from a stream.
|
||||
*/
|
||||
public ExtendedStatsBucketPipelineAggregatorBuilder(StreamInput in) throws IOException {
|
||||
public ExtendedStatsBucketPipelineAggregationBuilder(StreamInput in) throws IOException {
|
||||
super(in, ExtendedStatsBucketPipelineAggregator.TYPE.name());
|
||||
sigma = in.readDouble();
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ public class ExtendedStatsBucketPipelineAggregatorBuilder
|
|||
* Set the value of sigma to use when calculating the standard deviation
|
||||
* bounds
|
||||
*/
|
||||
public ExtendedStatsBucketPipelineAggregatorBuilder sigma(double sigma) {
|
||||
public ExtendedStatsBucketPipelineAggregationBuilder sigma(double sigma) {
|
||||
if (sigma < 0.0) {
|
||||
throw new IllegalArgumentException(ExtendedStatsBucketParser.SIGMA.getPreferredName() + " must be a non-negative double");
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ public class ExtendedStatsBucketPipelineAggregatorBuilder
|
|||
|
||||
@Override
|
||||
public void doValidate(AggregatorFactory<?> parent, AggregatorFactory<?>[] aggFactories,
|
||||
List<PipelineAggregatorBuilder> pipelineAggregatorFactories) {
|
||||
List<PipelineAggregationBuilder> pipelineAggregatorFactories) {
|
||||
if (bucketsPaths.length != 1) {
|
||||
throw new IllegalStateException(Parser.BUCKETS_PATH.getPreferredName()
|
||||
+ " must contain a single entry for aggregation [" + name + "]");
|
||||
|
@ -109,8 +109,8 @@ public class ExtendedStatsBucketPipelineAggregatorBuilder
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean innerEquals(BucketMetricsPipelineAggregatorBuilder<ExtendedStatsBucketPipelineAggregatorBuilder> obj) {
|
||||
ExtendedStatsBucketPipelineAggregatorBuilder other = (ExtendedStatsBucketPipelineAggregatorBuilder) obj;
|
||||
protected boolean innerEquals(BucketMetricsPipelineAggregationBuilder<ExtendedStatsBucketPipelineAggregationBuilder> obj) {
|
||||
ExtendedStatsBucketPipelineAggregationBuilder other = (ExtendedStatsBucketPipelineAggregationBuilder) obj;
|
||||
return Objects.equals(sigma, other.sigma);
|
||||
}
|
||||
|
|
@ -24,27 +24,27 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
|||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.search.aggregations.AggregatorFactory;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsParser;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsPipelineAggregationBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class SumBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAggregatorBuilder<SumBucketPipelineAggregatorBuilder> {
|
||||
public class SumBucketPipelineAggregationBuilder extends BucketMetricsPipelineAggregationBuilder<SumBucketPipelineAggregationBuilder> {
|
||||
public static final String NAME = SumBucketPipelineAggregator.TYPE.name();
|
||||
public static final ParseField AGGREGATION_NAME_FIELD = new ParseField(NAME);
|
||||
|
||||
public SumBucketPipelineAggregatorBuilder(String name, String bucketsPath) {
|
||||
public SumBucketPipelineAggregationBuilder(String name, String bucketsPath) {
|
||||
super(name, SumBucketPipelineAggregator.TYPE.name(), new String[] { bucketsPath });
|
||||
}
|
||||
|
||||
/**
|
||||
* Read from a stream.
|
||||
*/
|
||||
public SumBucketPipelineAggregatorBuilder(StreamInput in) throws IOException {
|
||||
public SumBucketPipelineAggregationBuilder(StreamInput in) throws IOException {
|
||||
super(in, NAME);
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ public class SumBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAgg
|
|||
|
||||
@Override
|
||||
public void doValidate(AggregatorFactory<?> parent, AggregatorFactory<?>[] aggFactories,
|
||||
List<PipelineAggregatorBuilder> pipelineAggregatorFactories) {
|
||||
List<PipelineAggregationBuilder> pipelineAggregatorFactories) {
|
||||
if (bucketsPaths.length != 1) {
|
||||
throw new IllegalStateException(PipelineAggregator.Parser.BUCKETS_PATH.getPreferredName()
|
||||
+ " must contain a single entry for aggregation [" + name + "]");
|
||||
|
@ -74,9 +74,9 @@ public class SumBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAgg
|
|||
|
||||
public static final PipelineAggregator.Parser PARSER = new BucketMetricsParser() {
|
||||
@Override
|
||||
protected SumBucketPipelineAggregatorBuilder buildFactory(String pipelineAggregatorName,
|
||||
protected SumBucketPipelineAggregationBuilder buildFactory(String pipelineAggregatorName,
|
||||
String bucketsPath, Map<String, Object> params) {
|
||||
return new SumBucketPipelineAggregatorBuilder(pipelineAggregatorName, bucketsPath);
|
||||
return new SumBucketPipelineAggregationBuilder(pipelineAggregatorName, bucketsPath);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -86,7 +86,7 @@ public class SumBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAgg
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean innerEquals(BucketMetricsPipelineAggregatorBuilder<SumBucketPipelineAggregatorBuilder> other) {
|
||||
protected boolean innerEquals(BucketMetricsPipelineAggregationBuilder<SumBucketPipelineAggregationBuilder> other) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -29,7 +29,7 @@ import org.elasticsearch.index.query.QueryParseContext;
|
|||
import org.elasticsearch.script.Script;
|
||||
import org.elasticsearch.script.Script.ScriptField;
|
||||
import org.elasticsearch.search.DocValueFormat;
|
||||
import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy;
|
||||
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
|
||||
|
||||
|
@ -46,7 +46,7 @@ import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.
|
|||
import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser.FORMAT;
|
||||
import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser.GAP_POLICY;
|
||||
|
||||
public class BucketScriptPipelineAggregatorBuilder extends AbstractPipelineAggregatorBuilder<BucketScriptPipelineAggregatorBuilder> {
|
||||
public class BucketScriptPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder<BucketScriptPipelineAggregationBuilder> {
|
||||
public static final String NAME = BucketScriptPipelineAggregator.TYPE.name();
|
||||
public static final ParseField AGGREGATION_NAME_FIELD = new ParseField(NAME);
|
||||
|
||||
|
@ -55,21 +55,21 @@ public class BucketScriptPipelineAggregatorBuilder extends AbstractPipelineAggre
|
|||
private String format = null;
|
||||
private GapPolicy gapPolicy = GapPolicy.SKIP;
|
||||
|
||||
public BucketScriptPipelineAggregatorBuilder(String name, Map<String, String> bucketsPathsMap, Script script) {
|
||||
public BucketScriptPipelineAggregationBuilder(String name, Map<String, String> bucketsPathsMap, Script script) {
|
||||
super(name, BucketScriptPipelineAggregator.TYPE.name(), new TreeMap<>(bucketsPathsMap).values()
|
||||
.toArray(new String[bucketsPathsMap.size()]));
|
||||
this.bucketsPathsMap = bucketsPathsMap;
|
||||
this.script = script;
|
||||
}
|
||||
|
||||
public BucketScriptPipelineAggregatorBuilder(String name, Script script, String... bucketsPaths) {
|
||||
public BucketScriptPipelineAggregationBuilder(String name, Script script, String... bucketsPaths) {
|
||||
this(name, convertToBucketsPathMap(bucketsPaths), script);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read from a stream.
|
||||
*/
|
||||
public BucketScriptPipelineAggregatorBuilder(StreamInput in) throws IOException {
|
||||
public BucketScriptPipelineAggregationBuilder(StreamInput in) throws IOException {
|
||||
super(in, BucketScriptPipelineAggregator.TYPE.name());
|
||||
int mapSize = in.readVInt();
|
||||
bucketsPathsMap = new HashMap<String, String>(mapSize);
|
||||
|
@ -104,7 +104,7 @@ public class BucketScriptPipelineAggregatorBuilder extends AbstractPipelineAggre
|
|||
/**
|
||||
* Sets the format to use on the output of this aggregation.
|
||||
*/
|
||||
public BucketScriptPipelineAggregatorBuilder format(String format) {
|
||||
public BucketScriptPipelineAggregationBuilder format(String format) {
|
||||
if (format == null) {
|
||||
throw new IllegalArgumentException("[format] must not be null: [" + name + "]");
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ public class BucketScriptPipelineAggregatorBuilder extends AbstractPipelineAggre
|
|||
/**
|
||||
* Sets the gap policy to use for this aggregation.
|
||||
*/
|
||||
public BucketScriptPipelineAggregatorBuilder gapPolicy(GapPolicy gapPolicy) {
|
||||
public BucketScriptPipelineAggregationBuilder gapPolicy(GapPolicy gapPolicy) {
|
||||
if (gapPolicy == null) {
|
||||
throw new IllegalArgumentException("[gapPolicy] must not be null: [" + name + "]");
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ public class BucketScriptPipelineAggregatorBuilder extends AbstractPipelineAggre
|
|||
return builder;
|
||||
}
|
||||
|
||||
public static BucketScriptPipelineAggregatorBuilder parse(String reducerName, QueryParseContext context) throws IOException {
|
||||
public static BucketScriptPipelineAggregationBuilder parse(String reducerName, QueryParseContext context) throws IOException {
|
||||
XContentParser parser = context.parser();
|
||||
XContentParser.Token token;
|
||||
Script script = null;
|
||||
|
@ -230,8 +230,8 @@ public class BucketScriptPipelineAggregatorBuilder extends AbstractPipelineAggre
|
|||
+ "] for series_arithmetic aggregation [" + reducerName + "]");
|
||||
}
|
||||
|
||||
BucketScriptPipelineAggregatorBuilder factory =
|
||||
new BucketScriptPipelineAggregatorBuilder(reducerName, bucketsPathsMap, script);
|
||||
BucketScriptPipelineAggregationBuilder factory =
|
||||
new BucketScriptPipelineAggregationBuilder(reducerName, bucketsPathsMap, script);
|
||||
if (format != null) {
|
||||
factory.format(format);
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ public class BucketScriptPipelineAggregatorBuilder extends AbstractPipelineAggre
|
|||
|
||||
@Override
|
||||
protected boolean doEquals(Object obj) {
|
||||
BucketScriptPipelineAggregatorBuilder other = (BucketScriptPipelineAggregatorBuilder) obj;
|
||||
BucketScriptPipelineAggregationBuilder other = (BucketScriptPipelineAggregationBuilder) obj;
|
||||
return Objects.equals(bucketsPathsMap, other.bucketsPathsMap) && Objects.equals(script, other.script)
|
||||
&& Objects.equals(format, other.format) && Objects.equals(gapPolicy, other.gapPolicy);
|
||||
}
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.common.xcontent.XContentParser;
|
|||
import org.elasticsearch.index.query.QueryParseContext;
|
||||
import org.elasticsearch.script.Script;
|
||||
import org.elasticsearch.script.Script.ScriptField;
|
||||
import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy;
|
||||
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
|
||||
|
||||
|
@ -44,7 +44,7 @@ import java.util.TreeMap;
|
|||
import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser.BUCKETS_PATH;
|
||||
import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser.GAP_POLICY;
|
||||
|
||||
public class BucketSelectorPipelineAggregatorBuilder extends AbstractPipelineAggregatorBuilder<BucketSelectorPipelineAggregatorBuilder> {
|
||||
public class BucketSelectorPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder<BucketSelectorPipelineAggregationBuilder> {
|
||||
public static final String NAME = BucketSelectorPipelineAggregator.TYPE.name();
|
||||
public static final ParseField AGGREGATION_NAME_FIELD = new ParseField(NAME);
|
||||
|
||||
|
@ -52,21 +52,21 @@ public class BucketSelectorPipelineAggregatorBuilder extends AbstractPipelineAgg
|
|||
private Script script;
|
||||
private GapPolicy gapPolicy = GapPolicy.SKIP;
|
||||
|
||||
public BucketSelectorPipelineAggregatorBuilder(String name, Map<String, String> bucketsPathsMap, Script script) {
|
||||
public BucketSelectorPipelineAggregationBuilder(String name, Map<String, String> bucketsPathsMap, Script script) {
|
||||
super(name, BucketSelectorPipelineAggregator.TYPE.name(), new TreeMap<>(bucketsPathsMap).values()
|
||||
.toArray(new String[bucketsPathsMap.size()]));
|
||||
this.bucketsPathsMap = bucketsPathsMap;
|
||||
this.script = script;
|
||||
}
|
||||
|
||||
public BucketSelectorPipelineAggregatorBuilder(String name, Script script, String... bucketsPaths) {
|
||||
public BucketSelectorPipelineAggregationBuilder(String name, Script script, String... bucketsPaths) {
|
||||
this(name, convertToBucketsPathMap(bucketsPaths), script);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read from a stream.
|
||||
*/
|
||||
public BucketSelectorPipelineAggregatorBuilder(StreamInput in) throws IOException {
|
||||
public BucketSelectorPipelineAggregationBuilder(StreamInput in) throws IOException {
|
||||
super(in, BucketSelectorPipelineAggregator.TYPE.name());
|
||||
int mapSize = in.readVInt();
|
||||
bucketsPathsMap = new HashMap<String, String>(mapSize);
|
||||
|
@ -99,7 +99,7 @@ public class BucketSelectorPipelineAggregatorBuilder extends AbstractPipelineAgg
|
|||
/**
|
||||
* Sets the gap policy to use for this aggregation.
|
||||
*/
|
||||
public BucketSelectorPipelineAggregatorBuilder gapPolicy(GapPolicy gapPolicy) {
|
||||
public BucketSelectorPipelineAggregationBuilder gapPolicy(GapPolicy gapPolicy) {
|
||||
if (gapPolicy == null) {
|
||||
throw new IllegalArgumentException("[gapPolicy] must not be null: [" + name + "]");
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ public class BucketSelectorPipelineAggregatorBuilder extends AbstractPipelineAgg
|
|||
return builder;
|
||||
}
|
||||
|
||||
public static BucketSelectorPipelineAggregatorBuilder parse(String reducerName, QueryParseContext context) throws IOException {
|
||||
public static BucketSelectorPipelineAggregationBuilder parse(String reducerName, QueryParseContext context) throws IOException {
|
||||
XContentParser parser = context.parser();
|
||||
XContentParser.Token token;
|
||||
Script script = null;
|
||||
|
@ -193,8 +193,8 @@ public class BucketSelectorPipelineAggregatorBuilder extends AbstractPipelineAgg
|
|||
+ "] for bucket_selector aggregation [" + reducerName + "]");
|
||||
}
|
||||
|
||||
BucketSelectorPipelineAggregatorBuilder factory =
|
||||
new BucketSelectorPipelineAggregatorBuilder(reducerName, bucketsPathsMap, script);
|
||||
BucketSelectorPipelineAggregationBuilder factory =
|
||||
new BucketSelectorPipelineAggregationBuilder(reducerName, bucketsPathsMap, script);
|
||||
if (gapPolicy != null) {
|
||||
factory.gapPolicy(gapPolicy);
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ public class BucketSelectorPipelineAggregatorBuilder extends AbstractPipelineAgg
|
|||
|
||||
@Override
|
||||
protected boolean doEquals(Object obj) {
|
||||
BucketSelectorPipelineAggregatorBuilder other = (BucketSelectorPipelineAggregatorBuilder) obj;
|
||||
BucketSelectorPipelineAggregationBuilder other = (BucketSelectorPipelineAggregationBuilder) obj;
|
||||
return Objects.equals(bucketsPathsMap, other.bucketsPathsMap) && Objects.equals(script, other.script)
|
||||
&& Objects.equals(gapPolicy, other.gapPolicy);
|
||||
}
|
|
@ -28,9 +28,9 @@ import org.elasticsearch.common.xcontent.XContentParser;
|
|||
import org.elasticsearch.index.query.QueryParseContext;
|
||||
import org.elasticsearch.search.DocValueFormat;
|
||||
import org.elasticsearch.search.aggregations.AggregatorFactory;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.bucket.histogram.AbstractHistogramAggregatorFactory;
|
||||
import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.BucketMetricsParser;
|
||||
|
||||
|
@ -43,20 +43,20 @@ import java.util.Objects;
|
|||
import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser.BUCKETS_PATH;
|
||||
import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser.FORMAT;
|
||||
|
||||
public class CumulativeSumPipelineAggregatorBuilder extends AbstractPipelineAggregatorBuilder<CumulativeSumPipelineAggregatorBuilder> {
|
||||
public class CumulativeSumPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder<CumulativeSumPipelineAggregationBuilder> {
|
||||
public static final String NAME = CumulativeSumPipelineAggregator.TYPE.name();
|
||||
public static final ParseField AGGREGATION_NAME_FIELD = new ParseField(NAME);
|
||||
|
||||
private String format;
|
||||
|
||||
public CumulativeSumPipelineAggregatorBuilder(String name, String bucketsPath) {
|
||||
public CumulativeSumPipelineAggregationBuilder(String name, String bucketsPath) {
|
||||
super(name, CumulativeSumPipelineAggregator.TYPE.name(), new String[] { bucketsPath });
|
||||
}
|
||||
|
||||
/**
|
||||
* Read from a stream.
|
||||
*/
|
||||
public CumulativeSumPipelineAggregatorBuilder(StreamInput in) throws IOException {
|
||||
public CumulativeSumPipelineAggregationBuilder(StreamInput in) throws IOException {
|
||||
super(in, CumulativeSumPipelineAggregator.TYPE.name());
|
||||
format = in.readOptionalString();
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public class CumulativeSumPipelineAggregatorBuilder extends AbstractPipelineAggr
|
|||
/**
|
||||
* Sets the format to use on the output of this aggregation.
|
||||
*/
|
||||
public CumulativeSumPipelineAggregatorBuilder format(String format) {
|
||||
public CumulativeSumPipelineAggregationBuilder format(String format) {
|
||||
if (format == null) {
|
||||
throw new IllegalArgumentException("[format] must not be null: [" + name + "]");
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ public class CumulativeSumPipelineAggregatorBuilder extends AbstractPipelineAggr
|
|||
|
||||
@Override
|
||||
public void doValidate(AggregatorFactory<?> parent, AggregatorFactory<?>[] aggFactories,
|
||||
List<PipelineAggregatorBuilder> pipelineAggregatorFactories) {
|
||||
List<PipelineAggregationBuilder> pipelineAggregatorFactories) {
|
||||
if (bucketsPaths.length != 1) {
|
||||
throw new IllegalStateException(BUCKETS_PATH.getPreferredName()
|
||||
+ " must contain a single entry for aggregation [" + name + "]");
|
||||
|
@ -124,7 +124,7 @@ public class CumulativeSumPipelineAggregatorBuilder extends AbstractPipelineAggr
|
|||
return builder;
|
||||
}
|
||||
|
||||
public static CumulativeSumPipelineAggregatorBuilder parse(String pipelineAggregatorName, QueryParseContext context)
|
||||
public static CumulativeSumPipelineAggregationBuilder parse(String pipelineAggregatorName, QueryParseContext context)
|
||||
throws IOException {
|
||||
XContentParser parser = context.parser();
|
||||
XContentParser.Token token;
|
||||
|
@ -167,8 +167,8 @@ public class CumulativeSumPipelineAggregatorBuilder extends AbstractPipelineAggr
|
|||
+ "] for derivative aggregation [" + pipelineAggregatorName + "]");
|
||||
}
|
||||
|
||||
CumulativeSumPipelineAggregatorBuilder factory =
|
||||
new CumulativeSumPipelineAggregatorBuilder(pipelineAggregatorName, bucketsPaths[0]);
|
||||
CumulativeSumPipelineAggregationBuilder factory =
|
||||
new CumulativeSumPipelineAggregationBuilder(pipelineAggregatorName, bucketsPaths[0]);
|
||||
if (format != null) {
|
||||
factory.format(format);
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ public class CumulativeSumPipelineAggregatorBuilder extends AbstractPipelineAggr
|
|||
|
||||
@Override
|
||||
protected boolean doEquals(Object obj) {
|
||||
CumulativeSumPipelineAggregatorBuilder other = (CumulativeSumPipelineAggregatorBuilder) obj;
|
||||
CumulativeSumPipelineAggregationBuilder other = (CumulativeSumPipelineAggregationBuilder) obj;
|
||||
return Objects.equals(format, other.format);
|
||||
}
|
||||
|
|
@ -30,11 +30,11 @@ import org.elasticsearch.common.xcontent.XContentParser;
|
|||
import org.elasticsearch.index.query.QueryParseContext;
|
||||
import org.elasticsearch.search.DocValueFormat;
|
||||
import org.elasticsearch.search.aggregations.AggregatorFactory;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.bucket.histogram.AbstractHistogramAggregatorFactory;
|
||||
import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregatorFactory;
|
||||
import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval;
|
||||
import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy;
|
||||
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
|
||||
import org.joda.time.DateTimeZone;
|
||||
|
@ -45,7 +45,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class DerivativePipelineAggregatorBuilder extends AbstractPipelineAggregatorBuilder<DerivativePipelineAggregatorBuilder> {
|
||||
public class DerivativePipelineAggregationBuilder extends AbstractPipelineAggregationBuilder<DerivativePipelineAggregationBuilder> {
|
||||
public static final String NAME = DerivativePipelineAggregator.TYPE.name();
|
||||
public static final ParseField AGGREGATION_NAME_FIELD = new ParseField(NAME);
|
||||
|
||||
|
@ -57,18 +57,18 @@ public class DerivativePipelineAggregatorBuilder extends AbstractPipelineAggrega
|
|||
private GapPolicy gapPolicy = GapPolicy.SKIP;
|
||||
private String units;
|
||||
|
||||
public DerivativePipelineAggregatorBuilder(String name, String bucketsPath) {
|
||||
public DerivativePipelineAggregationBuilder(String name, String bucketsPath) {
|
||||
this(name, new String[] { bucketsPath });
|
||||
}
|
||||
|
||||
private DerivativePipelineAggregatorBuilder(String name, String[] bucketsPaths) {
|
||||
private DerivativePipelineAggregationBuilder(String name, String[] bucketsPaths) {
|
||||
super(name, DerivativePipelineAggregator.TYPE.name(), bucketsPaths);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read from a stream.
|
||||
*/
|
||||
public DerivativePipelineAggregatorBuilder(StreamInput in) throws IOException {
|
||||
public DerivativePipelineAggregationBuilder(StreamInput in) throws IOException {
|
||||
super(in, DerivativePipelineAggregator.TYPE.name());
|
||||
format = in.readOptionalString();
|
||||
if (in.readBoolean()) {
|
||||
|
@ -88,7 +88,7 @@ public class DerivativePipelineAggregatorBuilder extends AbstractPipelineAggrega
|
|||
out.writeOptionalString(units);
|
||||
}
|
||||
|
||||
public DerivativePipelineAggregatorBuilder format(String format) {
|
||||
public DerivativePipelineAggregationBuilder format(String format) {
|
||||
if (format == null) {
|
||||
throw new IllegalArgumentException("[format] must not be null: [" + name + "]");
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class DerivativePipelineAggregatorBuilder extends AbstractPipelineAggrega
|
|||
return format;
|
||||
}
|
||||
|
||||
public DerivativePipelineAggregatorBuilder gapPolicy(GapPolicy gapPolicy) {
|
||||
public DerivativePipelineAggregationBuilder gapPolicy(GapPolicy gapPolicy) {
|
||||
if (gapPolicy == null) {
|
||||
throw new IllegalArgumentException("[gapPolicy] must not be null: [" + name + "]");
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ public class DerivativePipelineAggregatorBuilder extends AbstractPipelineAggrega
|
|||
return gapPolicy;
|
||||
}
|
||||
|
||||
public DerivativePipelineAggregatorBuilder unit(String units) {
|
||||
public DerivativePipelineAggregationBuilder unit(String units) {
|
||||
if (units == null) {
|
||||
throw new IllegalArgumentException("[units] must not be null: [" + name + "]");
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ public class DerivativePipelineAggregatorBuilder extends AbstractPipelineAggrega
|
|||
return this;
|
||||
}
|
||||
|
||||
public DerivativePipelineAggregatorBuilder unit(DateHistogramInterval units) {
|
||||
public DerivativePipelineAggregationBuilder unit(DateHistogramInterval units) {
|
||||
if (units == null) {
|
||||
throw new IllegalArgumentException("[units] must not be null: [" + name + "]");
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ public class DerivativePipelineAggregatorBuilder extends AbstractPipelineAggrega
|
|||
|
||||
@Override
|
||||
public void doValidate(AggregatorFactory<?> parent, AggregatorFactory<?>[] aggFactories,
|
||||
List<PipelineAggregatorBuilder> pipelineAggregatoractories) {
|
||||
List<PipelineAggregationBuilder> pipelineAggregatoractories) {
|
||||
if (bucketsPaths.length != 1) {
|
||||
throw new IllegalStateException(PipelineAggregator.Parser.BUCKETS_PATH.getPreferredName()
|
||||
+ " must contain a single entry for aggregation [" + name + "]");
|
||||
|
@ -188,7 +188,7 @@ public class DerivativePipelineAggregatorBuilder extends AbstractPipelineAggrega
|
|||
return builder;
|
||||
}
|
||||
|
||||
public static DerivativePipelineAggregatorBuilder parse(String pipelineAggregatorName, QueryParseContext context) throws IOException {
|
||||
public static DerivativePipelineAggregationBuilder parse(String pipelineAggregatorName, QueryParseContext context) throws IOException {
|
||||
XContentParser parser = context.parser();
|
||||
XContentParser.Token token;
|
||||
String currentFieldName = null;
|
||||
|
@ -236,8 +236,8 @@ public class DerivativePipelineAggregatorBuilder extends AbstractPipelineAggrega
|
|||
+ "] for derivative aggregation [" + pipelineAggregatorName + "]");
|
||||
}
|
||||
|
||||
DerivativePipelineAggregatorBuilder factory =
|
||||
new DerivativePipelineAggregatorBuilder(pipelineAggregatorName, bucketsPaths[0]);
|
||||
DerivativePipelineAggregationBuilder factory =
|
||||
new DerivativePipelineAggregationBuilder(pipelineAggregatorName, bucketsPaths[0]);
|
||||
if (format != null) {
|
||||
factory.format(format);
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ public class DerivativePipelineAggregatorBuilder extends AbstractPipelineAggrega
|
|||
|
||||
@Override
|
||||
protected boolean doEquals(Object obj) {
|
||||
DerivativePipelineAggregatorBuilder other = (DerivativePipelineAggregatorBuilder) obj;
|
||||
DerivativePipelineAggregationBuilder other = (DerivativePipelineAggregationBuilder) obj;
|
||||
if (!Objects.equals(format, other.format)) {
|
||||
return false;
|
||||
}
|
|
@ -29,9 +29,9 @@ import org.elasticsearch.common.xcontent.XContentParser;
|
|||
import org.elasticsearch.index.query.QueryParseContext;
|
||||
import org.elasticsearch.search.DocValueFormat;
|
||||
import org.elasticsearch.search.aggregations.AggregatorFactory;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.bucket.histogram.AbstractHistogramAggregatorFactory;
|
||||
import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy;
|
||||
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.models.MovAvgModel;
|
||||
|
@ -49,7 +49,7 @@ import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.
|
|||
import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser.FORMAT;
|
||||
import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser.GAP_POLICY;
|
||||
|
||||
public class MovAvgPipelineAggregatorBuilder extends AbstractPipelineAggregatorBuilder<MovAvgPipelineAggregatorBuilder> {
|
||||
public class MovAvgPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder<MovAvgPipelineAggregationBuilder> {
|
||||
public static final String NAME = MovAvgPipelineAggregator.TYPE.name();
|
||||
public static final ParseField AGGREGATION_FIELD_NAME = new ParseField(NAME);
|
||||
|
||||
|
@ -66,14 +66,14 @@ public class MovAvgPipelineAggregatorBuilder extends AbstractPipelineAggregatorB
|
|||
private int predict = 0;
|
||||
private Boolean minimize;
|
||||
|
||||
public MovAvgPipelineAggregatorBuilder(String name, String bucketsPath) {
|
||||
public MovAvgPipelineAggregationBuilder(String name, String bucketsPath) {
|
||||
super(name, MovAvgPipelineAggregator.TYPE.name(), new String[] { bucketsPath });
|
||||
}
|
||||
|
||||
/**
|
||||
* Read from a stream.
|
||||
*/
|
||||
public MovAvgPipelineAggregatorBuilder(StreamInput in) throws IOException {
|
||||
public MovAvgPipelineAggregationBuilder(StreamInput in) throws IOException {
|
||||
super(in, MovAvgPipelineAggregator.TYPE.name());
|
||||
format = in.readOptionalString();
|
||||
gapPolicy = GapPolicy.readFrom(in);
|
||||
|
@ -96,7 +96,7 @@ public class MovAvgPipelineAggregatorBuilder extends AbstractPipelineAggregatorB
|
|||
/**
|
||||
* Sets the format to use on the output of this aggregation.
|
||||
*/
|
||||
public MovAvgPipelineAggregatorBuilder format(String format) {
|
||||
public MovAvgPipelineAggregationBuilder format(String format) {
|
||||
if (format == null) {
|
||||
throw new IllegalArgumentException("[format] must not be null: [" + name + "]");
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ public class MovAvgPipelineAggregatorBuilder extends AbstractPipelineAggregatorB
|
|||
/**
|
||||
* Sets the GapPolicy to use on the output of this aggregation.
|
||||
*/
|
||||
public MovAvgPipelineAggregatorBuilder gapPolicy(GapPolicy gapPolicy) {
|
||||
public MovAvgPipelineAggregationBuilder gapPolicy(GapPolicy gapPolicy) {
|
||||
if (gapPolicy == null) {
|
||||
throw new IllegalArgumentException("[gapPolicy] must not be null: [" + name + "]");
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ public class MovAvgPipelineAggregatorBuilder extends AbstractPipelineAggregatorB
|
|||
* @param window
|
||||
* Size of window
|
||||
*/
|
||||
public MovAvgPipelineAggregatorBuilder window(int window) {
|
||||
public MovAvgPipelineAggregationBuilder window(int window) {
|
||||
if (window <= 0) {
|
||||
throw new IllegalArgumentException("[window] must be a positive integer: [" + name + "]");
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ public class MovAvgPipelineAggregatorBuilder extends AbstractPipelineAggregatorB
|
|||
* @param model
|
||||
* A MovAvgModel which has been prepopulated with settings
|
||||
*/
|
||||
public MovAvgPipelineAggregatorBuilder modelBuilder(MovAvgModelBuilder model) {
|
||||
public MovAvgPipelineAggregationBuilder modelBuilder(MovAvgModelBuilder model) {
|
||||
if (model == null) {
|
||||
throw new IllegalArgumentException("[model] must not be null: [" + name + "]");
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ public class MovAvgPipelineAggregatorBuilder extends AbstractPipelineAggregatorB
|
|||
* @param model
|
||||
* A MovAvgModel which has been prepopulated with settings
|
||||
*/
|
||||
public MovAvgPipelineAggregatorBuilder model(MovAvgModel model) {
|
||||
public MovAvgPipelineAggregationBuilder model(MovAvgModel model) {
|
||||
if (model == null) {
|
||||
throw new IllegalArgumentException("[model] must not be null: [" + name + "]");
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ public class MovAvgPipelineAggregatorBuilder extends AbstractPipelineAggregatorB
|
|||
* @param predict
|
||||
* Number of predictions to make
|
||||
*/
|
||||
public MovAvgPipelineAggregatorBuilder predict(int predict) {
|
||||
public MovAvgPipelineAggregationBuilder predict(int predict) {
|
||||
if (predict <= 0) {
|
||||
throw new IllegalArgumentException("predict must be greater than 0. Found [" + predict + "] in [" + name + "]");
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ public class MovAvgPipelineAggregatorBuilder extends AbstractPipelineAggregatorB
|
|||
* @param minimize
|
||||
* If the model should be fit to the underlying data
|
||||
*/
|
||||
public MovAvgPipelineAggregatorBuilder minimize(boolean minimize) {
|
||||
public MovAvgPipelineAggregationBuilder minimize(boolean minimize) {
|
||||
this.minimize = minimize;
|
||||
return this;
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ public class MovAvgPipelineAggregatorBuilder extends AbstractPipelineAggregatorB
|
|||
|
||||
@Override
|
||||
public void doValidate(AggregatorFactory<?> parent, AggregatorFactory<?>[] aggFactories,
|
||||
List<PipelineAggregatorBuilder> pipelineAggregatoractories) {
|
||||
List<PipelineAggregationBuilder> pipelineAggregatoractories) {
|
||||
if (minimize != null && minimize && !model.canBeMinimized()) {
|
||||
// If the user asks to minimize, but this model doesn't support
|
||||
// it, throw exception
|
||||
|
@ -296,7 +296,8 @@ public class MovAvgPipelineAggregatorBuilder extends AbstractPipelineAggregatorB
|
|||
return builder;
|
||||
}
|
||||
|
||||
public static MovAvgPipelineAggregatorBuilder parse(ParseFieldRegistry<MovAvgModel.AbstractModelParser> movingAverageMdelParserRegistry,
|
||||
public static MovAvgPipelineAggregationBuilder parse(
|
||||
ParseFieldRegistry<MovAvgModel.AbstractModelParser> movingAverageMdelParserRegistry,
|
||||
String pipelineAggregatorName, QueryParseContext context) throws IOException {
|
||||
XContentParser parser = context.parser();
|
||||
XContentParser.Token token;
|
||||
|
@ -381,8 +382,8 @@ public class MovAvgPipelineAggregatorBuilder extends AbstractPipelineAggregatorB
|
|||
+ "] for movingAvg aggregation [" + pipelineAggregatorName + "]");
|
||||
}
|
||||
|
||||
MovAvgPipelineAggregatorBuilder factory =
|
||||
new MovAvgPipelineAggregatorBuilder(pipelineAggregatorName, bucketsPaths[0]);
|
||||
MovAvgPipelineAggregationBuilder factory =
|
||||
new MovAvgPipelineAggregationBuilder(pipelineAggregatorName, bucketsPaths[0]);
|
||||
if (format != null) {
|
||||
factory.format(format);
|
||||
}
|
||||
|
@ -419,7 +420,7 @@ public class MovAvgPipelineAggregatorBuilder extends AbstractPipelineAggregatorB
|
|||
|
||||
@Override
|
||||
protected boolean doEquals(Object obj) {
|
||||
MovAvgPipelineAggregatorBuilder other = (MovAvgPipelineAggregatorBuilder) obj;
|
||||
MovAvgPipelineAggregationBuilder other = (MovAvgPipelineAggregationBuilder) obj;
|
||||
return Objects.equals(format, other.format)
|
||||
&& Objects.equals(gapPolicy, other.gapPolicy)
|
||||
&& Objects.equals(window, other.window)
|
|
@ -25,7 +25,7 @@ import org.elasticsearch.common.ParseFieldMatcher;
|
|||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregationBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
|
@ -120,8 +120,8 @@ public class EwmaModel extends MovAvgModel {
|
|||
|
||||
@Override
|
||||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
builder.field(MovAvgPipelineAggregatorBuilder.MODEL.getPreferredName(), NAME_FIELD.getPreferredName());
|
||||
builder.startObject(MovAvgPipelineAggregatorBuilder.SETTINGS.getPreferredName());
|
||||
builder.field(MovAvgPipelineAggregationBuilder.MODEL.getPreferredName(), NAME_FIELD.getPreferredName());
|
||||
builder.startObject(MovAvgPipelineAggregationBuilder.SETTINGS.getPreferredName());
|
||||
builder.field("alpha", alpha);
|
||||
builder.endObject();
|
||||
return builder;
|
||||
|
@ -174,8 +174,8 @@ public class EwmaModel extends MovAvgModel {
|
|||
|
||||
@Override
|
||||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
builder.field(MovAvgPipelineAggregatorBuilder.MODEL.getPreferredName(), NAME_FIELD.getPreferredName());
|
||||
builder.startObject(MovAvgPipelineAggregatorBuilder.SETTINGS.getPreferredName());
|
||||
builder.field(MovAvgPipelineAggregationBuilder.MODEL.getPreferredName(), NAME_FIELD.getPreferredName());
|
||||
builder.startObject(MovAvgPipelineAggregationBuilder.SETTINGS.getPreferredName());
|
||||
builder.field("alpha", alpha);
|
||||
|
||||
builder.endObject();
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.elasticsearch.common.ParseFieldMatcher;
|
|||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregationBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
|
@ -183,8 +183,8 @@ public class HoltLinearModel extends MovAvgModel {
|
|||
|
||||
@Override
|
||||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
builder.field(MovAvgPipelineAggregatorBuilder.MODEL.getPreferredName(), NAME_FIELD.getPreferredName());
|
||||
builder.startObject(MovAvgPipelineAggregatorBuilder.SETTINGS.getPreferredName());
|
||||
builder.field(MovAvgPipelineAggregationBuilder.MODEL.getPreferredName(), NAME_FIELD.getPreferredName());
|
||||
builder.startObject(MovAvgPipelineAggregationBuilder.SETTINGS.getPreferredName());
|
||||
builder.field("alpha", alpha);
|
||||
builder.field("beta", beta);
|
||||
builder.endObject();
|
||||
|
@ -255,8 +255,8 @@ public class HoltLinearModel extends MovAvgModel {
|
|||
|
||||
@Override
|
||||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
builder.field(MovAvgPipelineAggregatorBuilder.MODEL.getPreferredName(), NAME_FIELD.getPreferredName());
|
||||
builder.startObject(MovAvgPipelineAggregatorBuilder.SETTINGS.getPreferredName());
|
||||
builder.field(MovAvgPipelineAggregationBuilder.MODEL.getPreferredName(), NAME_FIELD.getPreferredName());
|
||||
builder.startObject(MovAvgPipelineAggregationBuilder.SETTINGS.getPreferredName());
|
||||
builder.field("alpha", alpha);
|
||||
builder.field("beta", beta);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
|||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.search.aggregations.AggregationExecutionException;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregationBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
|
@ -366,8 +366,8 @@ public class HoltWintersModel extends MovAvgModel {
|
|||
|
||||
@Override
|
||||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
builder.field(MovAvgPipelineAggregatorBuilder.MODEL.getPreferredName(), NAME_FIELD.getPreferredName());
|
||||
builder.startObject(MovAvgPipelineAggregatorBuilder.SETTINGS.getPreferredName());
|
||||
builder.field(MovAvgPipelineAggregationBuilder.MODEL.getPreferredName(), NAME_FIELD.getPreferredName());
|
||||
builder.startObject(MovAvgPipelineAggregationBuilder.SETTINGS.getPreferredName());
|
||||
builder.field("alpha", alpha);
|
||||
builder.field("beta", beta);
|
||||
builder.field("gamma", gamma);
|
||||
|
@ -495,8 +495,8 @@ public class HoltWintersModel extends MovAvgModel {
|
|||
|
||||
@Override
|
||||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
builder.field(MovAvgPipelineAggregatorBuilder.MODEL.getPreferredName(), NAME_FIELD.getPreferredName());
|
||||
builder.startObject(MovAvgPipelineAggregatorBuilder.SETTINGS.getPreferredName());
|
||||
builder.field(MovAvgPipelineAggregationBuilder.MODEL.getPreferredName(), NAME_FIELD.getPreferredName());
|
||||
builder.startObject(MovAvgPipelineAggregationBuilder.SETTINGS.getPreferredName());
|
||||
builder.field("alpha", alpha);
|
||||
builder.field("beta", beta);
|
||||
builder.field("gamma", gamma);
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.elasticsearch.common.ParseFieldMatcher;
|
|||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregationBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
|
@ -102,7 +102,7 @@ public class LinearModel extends MovAvgModel {
|
|||
|
||||
@Override
|
||||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
builder.field(MovAvgPipelineAggregatorBuilder.MODEL.getPreferredName(), NAME_FIELD.getPreferredName());
|
||||
builder.field(MovAvgPipelineAggregationBuilder.MODEL.getPreferredName(), NAME_FIELD.getPreferredName());
|
||||
return builder;
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ public class LinearModel extends MovAvgModel {
|
|||
public static class LinearModelBuilder implements MovAvgModelBuilder {
|
||||
@Override
|
||||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
builder.field(MovAvgPipelineAggregatorBuilder.MODEL.getPreferredName(), NAME_FIELD.getPreferredName());
|
||||
builder.field(MovAvgPipelineAggregationBuilder.MODEL.getPreferredName(), NAME_FIELD.getPreferredName());
|
||||
return builder;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.elasticsearch.common.ParseFieldMatcher;
|
|||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregationBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
|
@ -95,7 +95,7 @@ public class SimpleModel extends MovAvgModel {
|
|||
|
||||
@Override
|
||||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
builder.field(MovAvgPipelineAggregatorBuilder.MODEL.getPreferredName(), NAME);
|
||||
builder.field(MovAvgPipelineAggregationBuilder.MODEL.getPreferredName(), NAME);
|
||||
return builder;
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ public class SimpleModel extends MovAvgModel {
|
|||
public static class SimpleModelBuilder implements MovAvgModelBuilder {
|
||||
@Override
|
||||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
builder.field(MovAvgPipelineAggregatorBuilder.MODEL.getPreferredName(), NAME_FIELD.getPreferredName());
|
||||
builder.field(MovAvgPipelineAggregationBuilder.MODEL.getPreferredName(), NAME_FIELD.getPreferredName());
|
||||
return builder;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
|
|||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.index.query.QueryParseContext;
|
||||
import org.elasticsearch.search.DocValueFormat;
|
||||
import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy;
|
||||
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
|
||||
|
||||
|
@ -40,7 +40,7 @@ import java.util.Objects;
|
|||
import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser.BUCKETS_PATH;
|
||||
import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser.FORMAT;
|
||||
|
||||
public class SerialDiffPipelineAggregatorBuilder extends AbstractPipelineAggregatorBuilder<SerialDiffPipelineAggregatorBuilder> {
|
||||
public class SerialDiffPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder<SerialDiffPipelineAggregationBuilder> {
|
||||
public static final String NAME = SerialDiffPipelineAggregator.TYPE.name();
|
||||
public static final ParseField AGGREGATION_NAME_FIELD = new ParseField(NAME);
|
||||
|
||||
|
@ -51,14 +51,14 @@ public class SerialDiffPipelineAggregatorBuilder extends AbstractPipelineAggrega
|
|||
private GapPolicy gapPolicy = GapPolicy.SKIP;
|
||||
private int lag = 1;
|
||||
|
||||
public SerialDiffPipelineAggregatorBuilder(String name, String bucketsPath) {
|
||||
public SerialDiffPipelineAggregationBuilder(String name, String bucketsPath) {
|
||||
super(name, SerialDiffPipelineAggregator.TYPE.name(), new String[] { bucketsPath });
|
||||
}
|
||||
|
||||
/**
|
||||
* Read from a stream.
|
||||
*/
|
||||
public SerialDiffPipelineAggregatorBuilder(StreamInput in) throws IOException {
|
||||
public SerialDiffPipelineAggregationBuilder(StreamInput in) throws IOException {
|
||||
super(in, SerialDiffPipelineAggregator.TYPE.name());
|
||||
format = in.readOptionalString();
|
||||
gapPolicy = GapPolicy.readFrom(in);
|
||||
|
@ -75,7 +75,7 @@ public class SerialDiffPipelineAggregatorBuilder extends AbstractPipelineAggrega
|
|||
/**
|
||||
* Sets the lag to use when calculating the serial difference.
|
||||
*/
|
||||
public SerialDiffPipelineAggregatorBuilder lag(int lag) {
|
||||
public SerialDiffPipelineAggregationBuilder lag(int lag) {
|
||||
if (lag <= 0) {
|
||||
throw new IllegalArgumentException("[lag] must be a positive integer: [" + name + "]");
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ public class SerialDiffPipelineAggregatorBuilder extends AbstractPipelineAggrega
|
|||
/**
|
||||
* Sets the format to use on the output of this aggregation.
|
||||
*/
|
||||
public SerialDiffPipelineAggregatorBuilder format(String format) {
|
||||
public SerialDiffPipelineAggregationBuilder format(String format) {
|
||||
if (format == null) {
|
||||
throw new IllegalArgumentException("[format] must not be null: [" + name + "]");
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ public class SerialDiffPipelineAggregatorBuilder extends AbstractPipelineAggrega
|
|||
/**
|
||||
* Sets the GapPolicy to use on the output of this aggregation.
|
||||
*/
|
||||
public SerialDiffPipelineAggregatorBuilder gapPolicy(GapPolicy gapPolicy) {
|
||||
public SerialDiffPipelineAggregationBuilder gapPolicy(GapPolicy gapPolicy) {
|
||||
if (gapPolicy == null) {
|
||||
throw new IllegalArgumentException("[gapPolicy] must not be null: [" + name + "]");
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ public class SerialDiffPipelineAggregatorBuilder extends AbstractPipelineAggrega
|
|||
return builder;
|
||||
}
|
||||
|
||||
public static SerialDiffPipelineAggregatorBuilder parse(String reducerName, QueryParseContext context) throws IOException {
|
||||
public static SerialDiffPipelineAggregationBuilder parse(String reducerName, QueryParseContext context) throws IOException {
|
||||
XContentParser parser = context.parser();
|
||||
XContentParser.Token token;
|
||||
String currentFieldName = null;
|
||||
|
@ -208,8 +208,8 @@ public class SerialDiffPipelineAggregatorBuilder extends AbstractPipelineAggrega
|
|||
"Missing required field [" + BUCKETS_PATH.getPreferredName() + "] for derivative aggregation [" + reducerName + "]");
|
||||
}
|
||||
|
||||
SerialDiffPipelineAggregatorBuilder factory =
|
||||
new SerialDiffPipelineAggregatorBuilder(reducerName, bucketsPaths[0]);
|
||||
SerialDiffPipelineAggregationBuilder factory =
|
||||
new SerialDiffPipelineAggregationBuilder(reducerName, bucketsPaths[0]);
|
||||
if (lag != null) {
|
||||
factory.lag(lag);
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ public class SerialDiffPipelineAggregatorBuilder extends AbstractPipelineAggrega
|
|||
}
|
||||
@Override
|
||||
protected boolean doEquals(Object obj) {
|
||||
SerialDiffPipelineAggregatorBuilder other = (SerialDiffPipelineAggregatorBuilder) obj;
|
||||
SerialDiffPipelineAggregationBuilder other = (SerialDiffPipelineAggregationBuilder) obj;
|
||||
return Objects.equals(format, other.format)
|
||||
&& Objects.equals(gapPolicy, other.gapPolicy)
|
||||
&& Objects.equals(lag, other.lag);
|
|
@ -45,7 +45,7 @@ import org.elasticsearch.search.aggregations.AggregationBuilder;
|
|||
import org.elasticsearch.search.slice.SliceBuilder;
|
||||
import org.elasticsearch.search.aggregations.AggregatorFactories;
|
||||
import org.elasticsearch.search.aggregations.AggregatorParsers;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.fetch.source.FetchSourceContext;
|
||||
import org.elasticsearch.search.highlight.HighlightBuilder;
|
||||
import org.elasticsearch.search.internal.SearchContext;
|
||||
|
@ -591,7 +591,7 @@ public final class SearchSourceBuilder extends ToXContentToBytes implements Writ
|
|||
/**
|
||||
* Add an aggregation to perform as part of the search.
|
||||
*/
|
||||
public SearchSourceBuilder aggregation(PipelineAggregatorBuilder aggregation) {
|
||||
public SearchSourceBuilder aggregation(PipelineAggregationBuilder aggregation) {
|
||||
if (aggregations == null) {
|
||||
aggregations = AggregatorFactories.builder();
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ import org.elasticsearch.indices.query.IndicesQueriesRegistry;
|
|||
import org.elasticsearch.script.ScriptModule;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.search.SearchModule;
|
||||
import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregationBuilder;
|
||||
import org.elasticsearch.test.AbstractQueryTestCase;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
import org.elasticsearch.test.IndexSettingsModule;
|
||||
|
@ -70,7 +70,7 @@ import static org.elasticsearch.test.ClusterServiceUtils.createClusterService;
|
|||
import static org.elasticsearch.test.ClusterServiceUtils.setState;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
public abstract class BasePipelineAggregationTestCase<AF extends AbstractPipelineAggregatorBuilder<AF>> extends ESTestCase {
|
||||
public abstract class BasePipelineAggregationTestCase<AF extends AbstractPipelineAggregationBuilder<AF>> extends ESTestCase {
|
||||
|
||||
protected static final String STRING_FIELD_NAME = "mapped_string";
|
||||
protected static final String INT_FIELD_NAME = "mapped_int";
|
||||
|
@ -198,7 +198,7 @@ public abstract class BasePipelineAggregationTestCase<AF extends AbstractPipelin
|
|||
assertSame(XContentParser.Token.FIELD_NAME, parser.nextToken());
|
||||
assertEquals(testAgg.type(), parser.currentName());
|
||||
assertSame(XContentParser.Token.START_OBJECT, parser.nextToken());
|
||||
PipelineAggregatorBuilder newAgg = aggParsers.pipelineParser(testAgg.getWriteableName(), ParseFieldMatcher.STRICT)
|
||||
PipelineAggregationBuilder newAgg = aggParsers.pipelineParser(testAgg.getWriteableName(), ParseFieldMatcher.STRICT)
|
||||
.parse(testAgg.getName(), parseContext);
|
||||
assertSame(XContentParser.Token.END_OBJECT, parser.currentToken());
|
||||
assertSame(XContentParser.Token.END_OBJECT, parser.nextToken());
|
||||
|
@ -219,7 +219,7 @@ public abstract class BasePipelineAggregationTestCase<AF extends AbstractPipelin
|
|||
try (BytesStreamOutput output = new BytesStreamOutput()) {
|
||||
output.writeNamedWriteable(testAgg);
|
||||
try (StreamInput in = new NamedWriteableAwareStreamInput(StreamInput.wrap(output.bytes()), namedWriteableRegistry)) {
|
||||
PipelineAggregatorBuilder deserializedQuery = in.readNamedWriteable(PipelineAggregatorBuilder.class);
|
||||
PipelineAggregationBuilder deserializedQuery = in.readNamedWriteable(PipelineAggregationBuilder.class);
|
||||
assertEquals(deserializedQuery, testAgg);
|
||||
assertEquals(deserializedQuery.hashCode(), testAgg.hashCode());
|
||||
assertNotSame(deserializedQuery, testAgg);
|
||||
|
@ -260,7 +260,7 @@ public abstract class BasePipelineAggregationTestCase<AF extends AbstractPipelin
|
|||
output.writeNamedWriteable(agg);
|
||||
try (StreamInput in = new NamedWriteableAwareStreamInput(StreamInput.wrap(output.bytes()), namedWriteableRegistry)) {
|
||||
@SuppressWarnings("unchecked")
|
||||
AF secondAgg = (AF) in.readNamedWriteable(PipelineAggregatorBuilder.class);
|
||||
AF secondAgg = (AF) in.readNamedWriteable(PipelineAggregationBuilder.class);
|
||||
return secondAgg;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,15 +23,15 @@ import org.elasticsearch.script.Script;
|
|||
import org.elasticsearch.script.ScriptService.ScriptType;
|
||||
import org.elasticsearch.search.aggregations.BasePipelineAggregationTestCase;
|
||||
import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketscript.BucketScriptPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketscript.BucketScriptPipelineAggregationBuilder;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class BucketScriptTests extends BasePipelineAggregationTestCase<BucketScriptPipelineAggregatorBuilder> {
|
||||
public class BucketScriptTests extends BasePipelineAggregationTestCase<BucketScriptPipelineAggregationBuilder> {
|
||||
|
||||
@Override
|
||||
protected BucketScriptPipelineAggregatorBuilder createTestAggregatorFactory() {
|
||||
protected BucketScriptPipelineAggregationBuilder createTestAggregatorFactory() {
|
||||
String name = randomAsciiOfLengthBetween(3, 20);
|
||||
Map<String, String> bucketsPaths = new HashMap<>();
|
||||
int numBucketPaths = randomIntBetween(1, 10);
|
||||
|
@ -49,7 +49,7 @@ public class BucketScriptTests extends BasePipelineAggregationTestCase<BucketScr
|
|||
}
|
||||
script = new Script("script", randomFrom(ScriptType.values()), randomFrom("my_lang", null), params);
|
||||
}
|
||||
BucketScriptPipelineAggregatorBuilder factory = new BucketScriptPipelineAggregatorBuilder(name, bucketsPaths, script);
|
||||
BucketScriptPipelineAggregationBuilder factory = new BucketScriptPipelineAggregationBuilder(name, bucketsPaths, script);
|
||||
if (randomBoolean()) {
|
||||
factory.format(randomAsciiOfLengthBetween(1, 10));
|
||||
}
|
||||
|
|
|
@ -23,15 +23,15 @@ import org.elasticsearch.script.Script;
|
|||
import org.elasticsearch.script.ScriptService.ScriptType;
|
||||
import org.elasticsearch.search.aggregations.BasePipelineAggregationTestCase;
|
||||
import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketselector.BucketSelectorPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketselector.BucketSelectorPipelineAggregationBuilder;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class BucketSelectorTests extends BasePipelineAggregationTestCase<BucketSelectorPipelineAggregatorBuilder> {
|
||||
public class BucketSelectorTests extends BasePipelineAggregationTestCase<BucketSelectorPipelineAggregationBuilder> {
|
||||
|
||||
@Override
|
||||
protected BucketSelectorPipelineAggregatorBuilder createTestAggregatorFactory() {
|
||||
protected BucketSelectorPipelineAggregationBuilder createTestAggregatorFactory() {
|
||||
String name = randomAsciiOfLengthBetween(3, 20);
|
||||
Map<String, String> bucketsPaths = new HashMap<>();
|
||||
int numBucketPaths = randomIntBetween(1, 10);
|
||||
|
@ -49,7 +49,7 @@ public class BucketSelectorTests extends BasePipelineAggregationTestCase<BucketS
|
|||
}
|
||||
script = new Script("script", randomFrom(ScriptType.values()), randomFrom("my_lang", null), params);
|
||||
}
|
||||
BucketSelectorPipelineAggregatorBuilder factory = new BucketSelectorPipelineAggregatorBuilder(name, bucketsPaths, script);
|
||||
BucketSelectorPipelineAggregationBuilder factory = new BucketSelectorPipelineAggregationBuilder(name, bucketsPaths, script);
|
||||
if (randomBoolean()) {
|
||||
factory.gapPolicy(randomFrom(GapPolicy.values()));
|
||||
}
|
||||
|
|
|
@ -20,15 +20,15 @@
|
|||
package org.elasticsearch.search.aggregations.pipeline;
|
||||
|
||||
import org.elasticsearch.search.aggregations.BasePipelineAggregationTestCase;
|
||||
import org.elasticsearch.search.aggregations.pipeline.cumulativesum.CumulativeSumPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.cumulativesum.CumulativeSumPipelineAggregationBuilder;
|
||||
|
||||
public class CumulativeSumTests extends BasePipelineAggregationTestCase<CumulativeSumPipelineAggregatorBuilder> {
|
||||
public class CumulativeSumTests extends BasePipelineAggregationTestCase<CumulativeSumPipelineAggregationBuilder> {
|
||||
|
||||
@Override
|
||||
protected CumulativeSumPipelineAggregatorBuilder createTestAggregatorFactory() {
|
||||
protected CumulativeSumPipelineAggregationBuilder createTestAggregatorFactory() {
|
||||
String name = randomAsciiOfLengthBetween(3, 20);
|
||||
String bucketsPath = randomAsciiOfLengthBetween(3, 20);
|
||||
CumulativeSumPipelineAggregatorBuilder factory = new CumulativeSumPipelineAggregatorBuilder(name, bucketsPath);
|
||||
CumulativeSumPipelineAggregationBuilder factory = new CumulativeSumPipelineAggregationBuilder(name, bucketsPath);
|
||||
if (randomBoolean()) {
|
||||
factory.format(randomAsciiOfLengthBetween(1, 10));
|
||||
}
|
||||
|
|
|
@ -21,15 +21,15 @@ package org.elasticsearch.search.aggregations.pipeline;
|
|||
|
||||
import org.elasticsearch.search.aggregations.BasePipelineAggregationTestCase;
|
||||
import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy;
|
||||
import org.elasticsearch.search.aggregations.pipeline.derivative.DerivativePipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.derivative.DerivativePipelineAggregationBuilder;
|
||||
|
||||
public class DerivativeTests extends BasePipelineAggregationTestCase<DerivativePipelineAggregatorBuilder> {
|
||||
public class DerivativeTests extends BasePipelineAggregationTestCase<DerivativePipelineAggregationBuilder> {
|
||||
|
||||
@Override
|
||||
protected DerivativePipelineAggregatorBuilder createTestAggregatorFactory() {
|
||||
protected DerivativePipelineAggregationBuilder createTestAggregatorFactory() {
|
||||
String name = randomAsciiOfLengthBetween(3, 20);
|
||||
String bucketsPath = randomAsciiOfLengthBetween(3, 20);
|
||||
DerivativePipelineAggregatorBuilder factory = new DerivativePipelineAggregatorBuilder(name, bucketsPath);
|
||||
DerivativePipelineAggregationBuilder factory = new DerivativePipelineAggregationBuilder(name, bucketsPath);
|
||||
if (randomBoolean()) {
|
||||
factory.format(randomAsciiOfLengthBetween(1, 10));
|
||||
}
|
||||
|
|
|
@ -21,15 +21,15 @@ package org.elasticsearch.search.aggregations.pipeline;
|
|||
|
||||
import org.elasticsearch.search.aggregations.BasePipelineAggregationTestCase;
|
||||
import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy;
|
||||
import org.elasticsearch.search.aggregations.pipeline.serialdiff.SerialDiffPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.serialdiff.SerialDiffPipelineAggregationBuilder;
|
||||
|
||||
public class SerialDifferenceTests extends BasePipelineAggregationTestCase<SerialDiffPipelineAggregatorBuilder> {
|
||||
public class SerialDifferenceTests extends BasePipelineAggregationTestCase<SerialDiffPipelineAggregationBuilder> {
|
||||
|
||||
@Override
|
||||
protected SerialDiffPipelineAggregatorBuilder createTestAggregatorFactory() {
|
||||
protected SerialDiffPipelineAggregationBuilder createTestAggregatorFactory() {
|
||||
String name = randomAsciiOfLengthBetween(3, 20);
|
||||
String bucketsPath = randomAsciiOfLengthBetween(3, 20);
|
||||
SerialDiffPipelineAggregatorBuilder factory = new SerialDiffPipelineAggregatorBuilder(name, bucketsPath);
|
||||
SerialDiffPipelineAggregationBuilder factory = new SerialDiffPipelineAggregationBuilder(name, bucketsPath);
|
||||
if (randomBoolean()) {
|
||||
factory.format(randomAsciiOfLengthBetween(1, 10));
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ package org.elasticsearch.search.aggregations.pipeline.bucketmetrics;
|
|||
import org.elasticsearch.search.aggregations.BasePipelineAggregationTestCase;
|
||||
import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy;
|
||||
|
||||
public abstract class AbstractBucketMetricsTestCase<PAF extends BucketMetricsPipelineAggregatorBuilder<PAF>>
|
||||
public abstract class AbstractBucketMetricsTestCase<PAF extends BucketMetricsPipelineAggregationBuilder<PAF>>
|
||||
extends BasePipelineAggregationTestCase<PAF> {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
|
||||
package org.elasticsearch.search.aggregations.pipeline.bucketmetrics;
|
||||
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.avg.AvgBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.avg.AvgBucketPipelineAggregationBuilder;
|
||||
|
||||
public class AvgBucketTests extends AbstractBucketMetricsTestCase<AvgBucketPipelineAggregatorBuilder> {
|
||||
public class AvgBucketTests extends AbstractBucketMetricsTestCase<AvgBucketPipelineAggregationBuilder> {
|
||||
|
||||
@Override
|
||||
protected AvgBucketPipelineAggregatorBuilder doCreateTestAggregatorFactory(String name, String bucketsPath) {
|
||||
return new AvgBucketPipelineAggregatorBuilder(name, bucketsPath);
|
||||
protected AvgBucketPipelineAggregationBuilder doCreateTestAggregatorFactory(String name, String bucketsPath) {
|
||||
return new AvgBucketPipelineAggregationBuilder(name, bucketsPath);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -23,15 +23,15 @@ import org.elasticsearch.common.xcontent.XContentFactory;
|
|||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.index.query.QueryParseContext;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.extended.ExtendedStatsBucketPipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.extended.ExtendedStatsBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.extended.ExtendedStatsBucketPipelineAggregationBuilder;
|
||||
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
public class ExtendedStatsBucketTests extends AbstractBucketMetricsTestCase<ExtendedStatsBucketPipelineAggregatorBuilder> {
|
||||
public class ExtendedStatsBucketTests extends AbstractBucketMetricsTestCase<ExtendedStatsBucketPipelineAggregationBuilder> {
|
||||
|
||||
@Override
|
||||
protected ExtendedStatsBucketPipelineAggregatorBuilder doCreateTestAggregatorFactory(String name, String bucketsPath) {
|
||||
ExtendedStatsBucketPipelineAggregatorBuilder factory = new ExtendedStatsBucketPipelineAggregatorBuilder(name, bucketsPath);
|
||||
protected ExtendedStatsBucketPipelineAggregationBuilder doCreateTestAggregatorFactory(String name, String bucketsPath) {
|
||||
ExtendedStatsBucketPipelineAggregationBuilder factory = new ExtendedStatsBucketPipelineAggregationBuilder(name, bucketsPath);
|
||||
if (randomBoolean()) {
|
||||
factory.sigma(randomDoubleBetween(0.0, 10.0, false));
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ public class ExtendedStatsBucketTests extends AbstractBucketMetricsTestCase<Exte
|
|||
QueryParseContext parseContext = new QueryParseContext(queriesRegistry, parser, parseFieldMatcher);
|
||||
parser.nextToken(); // skip object start
|
||||
|
||||
ExtendedStatsBucketPipelineAggregatorBuilder builder = (ExtendedStatsBucketPipelineAggregatorBuilder) aggParsers
|
||||
ExtendedStatsBucketPipelineAggregationBuilder builder = (ExtendedStatsBucketPipelineAggregationBuilder) aggParsers
|
||||
.pipelineParser(ExtendedStatsBucketPipelineAggregator.TYPE.name(), parseFieldMatcher)
|
||||
.parse("test", parseContext);
|
||||
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
|
||||
package org.elasticsearch.search.aggregations.pipeline.bucketmetrics;
|
||||
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.max.MaxBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.max.MaxBucketPipelineAggregationBuilder;
|
||||
|
||||
public class MaxBucketTests extends AbstractBucketMetricsTestCase<MaxBucketPipelineAggregatorBuilder> {
|
||||
public class MaxBucketTests extends AbstractBucketMetricsTestCase<MaxBucketPipelineAggregationBuilder> {
|
||||
|
||||
@Override
|
||||
protected MaxBucketPipelineAggregatorBuilder doCreateTestAggregatorFactory(String name, String bucketsPath) {
|
||||
return new MaxBucketPipelineAggregatorBuilder(name, bucketsPath);
|
||||
protected MaxBucketPipelineAggregationBuilder doCreateTestAggregatorFactory(String name, String bucketsPath) {
|
||||
return new MaxBucketPipelineAggregationBuilder(name, bucketsPath);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
|
||||
package org.elasticsearch.search.aggregations.pipeline.bucketmetrics;
|
||||
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.min.MinBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.min.MinBucketPipelineAggregationBuilder;
|
||||
|
||||
public class MinBucketTests extends AbstractBucketMetricsTestCase<MinBucketPipelineAggregatorBuilder> {
|
||||
public class MinBucketTests extends AbstractBucketMetricsTestCase<MinBucketPipelineAggregationBuilder> {
|
||||
|
||||
@Override
|
||||
protected MinBucketPipelineAggregatorBuilder doCreateTestAggregatorFactory(String name, String bucketsPath) {
|
||||
return new MinBucketPipelineAggregatorBuilder(name, bucketsPath);
|
||||
protected MinBucketPipelineAggregationBuilder doCreateTestAggregatorFactory(String name, String bucketsPath) {
|
||||
return new MinBucketPipelineAggregationBuilder(name, bucketsPath);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -23,15 +23,15 @@ import org.elasticsearch.common.xcontent.XContentFactory;
|
|||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.index.query.QueryParseContext;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.percentile.PercentilesBucketPipelineAggregator;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.percentile.PercentilesBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.percentile.PercentilesBucketPipelineAggregationBuilder;
|
||||
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
public class PercentilesBucketTests extends AbstractBucketMetricsTestCase<PercentilesBucketPipelineAggregatorBuilder> {
|
||||
public class PercentilesBucketTests extends AbstractBucketMetricsTestCase<PercentilesBucketPipelineAggregationBuilder> {
|
||||
|
||||
@Override
|
||||
protected PercentilesBucketPipelineAggregatorBuilder doCreateTestAggregatorFactory(String name, String bucketsPath) {
|
||||
PercentilesBucketPipelineAggregatorBuilder factory = new PercentilesBucketPipelineAggregatorBuilder(name, bucketsPath);
|
||||
protected PercentilesBucketPipelineAggregationBuilder doCreateTestAggregatorFactory(String name, String bucketsPath) {
|
||||
PercentilesBucketPipelineAggregationBuilder factory = new PercentilesBucketPipelineAggregationBuilder(name, bucketsPath);
|
||||
if (randomBoolean()) {
|
||||
int numPercents = randomIntBetween(1, 20);
|
||||
double[] percents = new double[numPercents];
|
||||
|
@ -55,7 +55,7 @@ public class PercentilesBucketTests extends AbstractBucketMetricsTestCase<Percen
|
|||
QueryParseContext parseContext = new QueryParseContext(queriesRegistry, parser, parseFieldMatcher);
|
||||
parser.nextToken(); // skip object start
|
||||
|
||||
PercentilesBucketPipelineAggregatorBuilder builder = (PercentilesBucketPipelineAggregatorBuilder) aggParsers
|
||||
PercentilesBucketPipelineAggregationBuilder builder = (PercentilesBucketPipelineAggregationBuilder) aggParsers
|
||||
.pipelineParser(PercentilesBucketPipelineAggregator.TYPE.name(), parseFieldMatcher)
|
||||
.parse("test", parseContext);
|
||||
|
||||
|
|
|
@ -19,14 +19,14 @@
|
|||
|
||||
package org.elasticsearch.search.aggregations.pipeline.bucketmetrics;
|
||||
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.StatsBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.StatsBucketPipelineAggregationBuilder;
|
||||
|
||||
public class StatsBucketTests extends AbstractBucketMetricsTestCase<StatsBucketPipelineAggregatorBuilder> {
|
||||
public class StatsBucketTests extends AbstractBucketMetricsTestCase<StatsBucketPipelineAggregationBuilder> {
|
||||
|
||||
@Override
|
||||
protected StatsBucketPipelineAggregatorBuilder doCreateTestAggregatorFactory(String name,
|
||||
protected StatsBucketPipelineAggregationBuilder doCreateTestAggregatorFactory(String name,
|
||||
String bucketsPath) {
|
||||
return new StatsBucketPipelineAggregatorBuilder(name, bucketsPath);
|
||||
return new StatsBucketPipelineAggregationBuilder(name, bucketsPath);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
|
||||
package org.elasticsearch.search.aggregations.pipeline.bucketmetrics;
|
||||
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.sum.SumBucketPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.sum.SumBucketPipelineAggregationBuilder;
|
||||
|
||||
public class SumBucketTests extends AbstractBucketMetricsTestCase<SumBucketPipelineAggregatorBuilder> {
|
||||
public class SumBucketTests extends AbstractBucketMetricsTestCase<SumBucketPipelineAggregationBuilder> {
|
||||
|
||||
@Override
|
||||
protected SumBucketPipelineAggregatorBuilder doCreateTestAggregatorFactory(String name, String bucketsPath) {
|
||||
return new SumBucketPipelineAggregatorBuilder(name, bucketsPath);
|
||||
protected SumBucketPipelineAggregationBuilder doCreateTestAggregatorFactory(String name, String bucketsPath) {
|
||||
return new SumBucketPipelineAggregationBuilder(name, bucketsPath);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -24,9 +24,9 @@ import org.elasticsearch.common.xcontent.XContentFactory;
|
|||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.index.query.QueryParseContext;
|
||||
import org.elasticsearch.search.aggregations.BasePipelineAggregationTestCase;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.models.EwmaModel;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.models.HoltLinearModel;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.models.HoltWintersModel;
|
||||
|
@ -34,13 +34,13 @@ import org.elasticsearch.search.aggregations.pipeline.movavg.models.HoltWintersM
|
|||
import org.elasticsearch.search.aggregations.pipeline.movavg.models.LinearModel;
|
||||
import org.elasticsearch.search.aggregations.pipeline.movavg.models.SimpleModel;;
|
||||
|
||||
public class MovAvgTests extends BasePipelineAggregationTestCase<MovAvgPipelineAggregatorBuilder> {
|
||||
public class MovAvgTests extends BasePipelineAggregationTestCase<MovAvgPipelineAggregationBuilder> {
|
||||
|
||||
@Override
|
||||
protected MovAvgPipelineAggregatorBuilder createTestAggregatorFactory() {
|
||||
protected MovAvgPipelineAggregationBuilder createTestAggregatorFactory() {
|
||||
String name = randomAsciiOfLengthBetween(3, 20);
|
||||
String bucketsPath = randomAsciiOfLengthBetween(3, 20);
|
||||
MovAvgPipelineAggregatorBuilder factory = new MovAvgPipelineAggregatorBuilder(name, bucketsPath);
|
||||
MovAvgPipelineAggregationBuilder factory = new MovAvgPipelineAggregationBuilder(name, bucketsPath);
|
||||
if (randomBoolean()) {
|
||||
factory.format(randomAsciiOfLengthBetween(1, 10));
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ public class MovAvgTests extends BasePipelineAggregationTestCase<MovAvgPipelineA
|
|||
}
|
||||
|
||||
public void testDefaultParsing() throws Exception {
|
||||
MovAvgPipelineAggregatorBuilder expected = new MovAvgPipelineAggregatorBuilder("commits_moving_avg", "commits");
|
||||
MovAvgPipelineAggregationBuilder expected = new MovAvgPipelineAggregationBuilder("commits_moving_avg", "commits");
|
||||
String json = "{" +
|
||||
" \"commits_moving_avg\": {" +
|
||||
" \"moving_avg\": {" +
|
||||
|
@ -115,7 +115,7 @@ public class MovAvgTests extends BasePipelineAggregationTestCase<MovAvgPipelineA
|
|||
assertSame(XContentParser.Token.FIELD_NAME, parser.nextToken());
|
||||
assertEquals(expected.type(), parser.currentName());
|
||||
assertSame(XContentParser.Token.START_OBJECT, parser.nextToken());
|
||||
PipelineAggregatorBuilder newAgg = aggParsers.pipelineParser(expected.getWriteableName(), ParseFieldMatcher.STRICT)
|
||||
PipelineAggregationBuilder newAgg = aggParsers.pipelineParser(expected.getWriteableName(), ParseFieldMatcher.STRICT)
|
||||
.parse(expected.getName(), parseContext);
|
||||
assertSame(XContentParser.Token.END_OBJECT, parser.currentToken());
|
||||
assertSame(XContentParser.Token.END_OBJECT, parser.nextToken());
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
|
|||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
import org.elasticsearch.index.query.QueryBuilder;
|
||||
import org.elasticsearch.search.aggregations.AggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.highlight.HighlightBuilder;
|
||||
import org.elasticsearch.search.sort.SortBuilder;
|
||||
|
||||
|
@ -177,9 +177,9 @@ public class PercolateRequestBuilder extends ActionRequestBuilder<PercolateReque
|
|||
|
||||
/**
|
||||
* Delegates to
|
||||
* {@link PercolateSourceBuilder#addAggregation(PipelineAggregatorBuilder)}
|
||||
* {@link PercolateSourceBuilder#addAggregation(PipelineAggregationBuilder)}
|
||||
*/
|
||||
public PercolateRequestBuilder addAggregation(PipelineAggregatorBuilder aggregationBuilder) {
|
||||
public PercolateRequestBuilder addAggregation(PipelineAggregationBuilder aggregationBuilder) {
|
||||
sourceBuilder().addAggregation(aggregationBuilder);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.elasticsearch.common.xcontent.XContentFactory;
|
|||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
import org.elasticsearch.index.query.QueryBuilder;
|
||||
import org.elasticsearch.search.aggregations.AggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregatorBuilder;
|
||||
import org.elasticsearch.search.aggregations.PipelineAggregationBuilder;
|
||||
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
||||
import org.elasticsearch.search.highlight.HighlightBuilder;
|
||||
import org.elasticsearch.search.sort.ScoreSortBuilder;
|
||||
|
@ -57,7 +57,7 @@ public class PercolateSourceBuilder extends ToXContentToBytes {
|
|||
private Boolean trackScores;
|
||||
private HighlightBuilder highlightBuilder;
|
||||
private List<AggregationBuilder> aggregationBuilders;
|
||||
private List<PipelineAggregatorBuilder> pipelineAggregationBuilders;
|
||||
private List<PipelineAggregationBuilder> pipelineAggregationBuilders;
|
||||
|
||||
/**
|
||||
* Sets the document to run the percolate queries against.
|
||||
|
@ -140,7 +140,7 @@ public class PercolateSourceBuilder extends ToXContentToBytes {
|
|||
/**
|
||||
* Add an aggregation definition.
|
||||
*/
|
||||
public PercolateSourceBuilder addAggregation(PipelineAggregatorBuilder aggregationBuilder) {
|
||||
public PercolateSourceBuilder addAggregation(PipelineAggregationBuilder aggregationBuilder) {
|
||||
if (pipelineAggregationBuilders == null) {
|
||||
pipelineAggregationBuilders = new ArrayList<>();
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ public class PercolateSourceBuilder extends ToXContentToBytes {
|
|||
}
|
||||
}
|
||||
if (pipelineAggregationBuilders != null) {
|
||||
for (PipelineAggregatorBuilder aggregation : pipelineAggregationBuilders) {
|
||||
for (PipelineAggregationBuilder aggregation : pipelineAggregationBuilders) {
|
||||
aggregation.toXContent(builder, params);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue