diff --git a/core/src/main/java/org/elasticsearch/action/search/SearchRequestBuilder.java b/core/src/main/java/org/elasticsearch/action/search/SearchRequestBuilder.java index 173c15ec1a5..47be65521d6 100644 --- a/core/src/main/java/org/elasticsearch/action/search/SearchRequestBuilder.java +++ b/core/src/main/java/org/elasticsearch/action/search/SearchRequestBuilder.java @@ -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 reader, + public void registerPipelineAggregation(Writeable.Reader 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); } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/AbstractAggregationBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/AbstractAggregationBuilder.java index ef54cdf0ef5..e84d7684304 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/AbstractAggregationBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/AbstractAggregationBuilder.java @@ -80,7 +80,7 @@ public abstract class AbstractAggregationBuilder[0], - new ArrayList()); + new ArrayList()); private AggregatorFactory parent; private AggregatorFactory[] factories; - private List pipelineAggregatorFactories; + private List pipelineAggregatorFactories; public static Builder builder() { return new Builder(); } private AggregatorFactories(AggregatorFactory parent, AggregatorFactory[] factories, - List pipelineAggregators) { + List pipelineAggregators) { this.parent = parent; this.factories = factories; this.pipelineAggregatorFactories = pipelineAggregators; @@ -65,7 +65,7 @@ public class AggregatorFactories { public List createPipelineAggregators() throws IOException { List 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 names = new HashSet<>(); private final List aggregationBuilders = new ArrayList<>(); - private final List pipelineAggregatorBuilders = new ArrayList<>(); + private final List 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 orderedpipelineAggregators = null; + List orderedpipelineAggregators = null; if (skipResolveOrder) { orderedpipelineAggregators = new ArrayList<>(pipelineAggregatorBuilders); } else { @@ -213,21 +213,21 @@ public class AggregatorFactories { return new AggregatorFactories(parent, aggFactories, orderedpipelineAggregators); } - private List resolvePipelineAggregatorOrder( - List pipelineAggregatorBuilders, List aggBuilders) { - Map pipelineAggregatorBuildersMap = new HashMap<>(); - for (PipelineAggregatorBuilder builder : pipelineAggregatorBuilders) { + private List resolvePipelineAggregatorOrder( + List pipelineAggregatorBuilders, List aggBuilders) { + Map pipelineAggregatorBuildersMap = new HashMap<>(); + for (PipelineAggregationBuilder builder : pipelineAggregatorBuilders) { pipelineAggregatorBuildersMap.put(builder.getName(), builder); } Map aggBuildersMap = new HashMap<>(); for (AggregationBuilder aggBuilder : aggBuilders) { aggBuildersMap.put(aggBuilder.name, aggBuilder); } - List orderedPipelineAggregatorrs = new LinkedList<>(); - List unmarkedBuilders = new ArrayList(pipelineAggregatorBuilders); - Set temporarilyMarked = new HashSet(); + List orderedPipelineAggregatorrs = new LinkedList<>(); + List unmarkedBuilders = new ArrayList(pipelineAggregatorBuilders); + Set temporarilyMarked = new HashSet(); 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 aggBuildersMap, - Map pipelineAggregatorBuildersMap, - List orderedPipelineAggregators, List unmarkedBuilders, - Set temporarilyMarked, PipelineAggregatorBuilder builder) { + Map pipelineAggregatorBuildersMap, + List orderedPipelineAggregators, List unmarkedBuilders, + Set 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 subPipelineBuilders = aggBuilder.factoriesBuilder.pipelineAggregatorBuilders; - for (PipelineAggregatorBuilder subFactory : subPipelineBuilders) { + List 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 getPipelineAggregatorFactories() { + List 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); } } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/AggregatorParsers.java b/core/src/main/java/org/elasticsearch/search/aggregations/AggregatorParsers.java index 178c1666b18..df64d440dc0 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/AggregatorParsers.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/AggregatorParsers.java @@ -104,7 +104,7 @@ public class AggregatorParsers { } AggregationBuilder aggFactory = null; - PipelineAggregatorBuilder pipelineAggregatorFactory = null; + PipelineAggregationBuilder pipelineAggregatorFactory = null; AggregatorFactories.Builder subFactories = null; Map metaData = null; diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/PipelineAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/PipelineAggregationBuilder.java similarity index 86% rename from core/src/main/java/org/elasticsearch/search/aggregations/PipelineAggregatorBuilder.java rename to core/src/main/java/org/elasticsearch/search/aggregations/PipelineAggregationBuilder.java index 1931ec232d5..f9462325471 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/PipelineAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/PipelineAggregationBuilder.java @@ -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 pipelineAggregatorFactories); + List 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 metaData); + /** Associate metadata with this {@link PipelineAggregationBuilder}. */ + public abstract PipelineAggregationBuilder setMetaData(Map metaData); } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/AbstractPipelineAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/AbstractPipelineAggregationBuilder.java similarity index 86% rename from core/src/main/java/org/elasticsearch/search/aggregations/pipeline/AbstractPipelineAggregatorBuilder.java rename to core/src/main/java/org/elasticsearch/search/aggregations/pipeline/AbstractPipelineAggregationBuilder.java index fc308b1bcdd..4fb2ed91401 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/AbstractPipelineAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/AbstractPipelineAggregationBuilder.java @@ -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> - extends PipelineAggregatorBuilder { +public abstract class AbstractPipelineAggregationBuilder> + extends PipelineAggregationBuilder { /** * Field shared by many parsers. @@ -45,7 +45,7 @@ public abstract class AbstractPipelineAggregatorBuilder 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 parent, AggregatorFactory[] factories, - List pipelineAggregatorFactories) { + List pipelineAggregatorFactories) { doValidate(parent, factories, pipelineAggregatorFactories); } @@ -99,7 +99,7 @@ public abstract class AbstractPipelineAggregatorBuilder parent, AggregatorFactory[] factories, - List pipelineAggregatorFactories) { + List pipelineAggregatorFactories) { } @SuppressWarnings("unchecked") @@ -134,7 +134,7 @@ public abstract class AbstractPipelineAggregatorBuildertrue if the {@link AbstractPipelineAggregatorBuilder} + * @return true if the {@link AbstractPipelineAggregationBuilder} * overrides the XContent rendering of the bucketPath option. */ protected boolean overrideBucketsPath() { @@ -157,7 +157,7 @@ public abstract class AbstractPipelineAggregatorBuilder other = (AbstractPipelineAggregatorBuilder) obj; + AbstractPipelineAggregationBuilder other = (AbstractPipelineAggregationBuilder) obj; if (!Objects.equals(name, other.name)) return false; if (!Objects.equals(type, other.type)) diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketHelpers.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketHelpers.java index ea0973dd1a2..7e46105346d 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketHelpers.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketHelpers.java @@ -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()); } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/PipelineAggregator.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/PipelineAggregator.java index 4b0dea560a8..8f7ea955e91 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/PipelineAggregator.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/PipelineAggregator.java @@ -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; } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/PipelineAggregatorBuilders.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/PipelineAggregatorBuilders.java index 9d97fd6af8f..3dc33188495 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/PipelineAggregatorBuilders.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/PipelineAggregatorBuilders.java @@ -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 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 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); } } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/BucketMetricsParser.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/BucketMetricsParser.java index 8eddd83b7e2..9dee002ca29 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/BucketMetricsParser.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/BucketMetricsParser.java @@ -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 params); protected boolean token(XContentParser parser, QueryParseContext context, String field, diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/BucketMetricsPipelineAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/BucketMetricsPipelineAggregationBuilder.java similarity index 86% rename from core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/BucketMetricsPipelineAggregatorBuilder.java rename to core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/BucketMetricsPipelineAggregationBuilder.java index 4945fd3a2e5..be34236d044 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/BucketMetricsPipelineAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/BucketMetricsPipelineAggregationBuilder.java @@ -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> - extends AbstractPipelineAggregatorBuilder { +public abstract class BucketMetricsPipelineAggregationBuilder> + extends AbstractPipelineAggregationBuilder { 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 parent, AggregatorFactory[] aggFactories, - List pipelineAggregatorFactories) { + List 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 other = (BucketMetricsPipelineAggregatorBuilder) obj; + BucketMetricsPipelineAggregationBuilder other = (BucketMetricsPipelineAggregationBuilder) obj; return Objects.equals(format, other.format) && Objects.equals(gapPolicy, other.gapPolicy) && innerEquals(other); } - protected abstract boolean innerEquals(BucketMetricsPipelineAggregatorBuilder other); + protected abstract boolean innerEquals(BucketMetricsPipelineAggregationBuilder other); } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/avg/AvgBucketPipelineAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/avg/AvgBucketPipelineAggregationBuilder.java similarity index 78% rename from core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/avg/AvgBucketPipelineAggregatorBuilder.java rename to core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/avg/AvgBucketPipelineAggregationBuilder.java index 509b45868b1..d7d7a1e0c57 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/avg/AvgBucketPipelineAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/avg/AvgBucketPipelineAggregationBuilder.java @@ -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 { +public class AvgBucketPipelineAggregationBuilder extends BucketMetricsPipelineAggregationBuilder { 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 pipelineAggregatorFactories) { + List 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 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 other) { + protected boolean innerEquals(BucketMetricsPipelineAggregationBuilder other) { return true; } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/max/MaxBucketPipelineAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/max/MaxBucketPipelineAggregationBuilder.java similarity index 78% rename from core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/max/MaxBucketPipelineAggregatorBuilder.java rename to core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/max/MaxBucketPipelineAggregationBuilder.java index 2800a63661d..0c4fc632b95 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/max/MaxBucketPipelineAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/max/MaxBucketPipelineAggregationBuilder.java @@ -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 { +public class MaxBucketPipelineAggregationBuilder extends BucketMetricsPipelineAggregationBuilder { 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 pipelineAggregatorFactories) { + List 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 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 other) { + protected boolean innerEquals(BucketMetricsPipelineAggregationBuilder other) { return true; } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/min/MinBucketPipelineAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/min/MinBucketPipelineAggregationBuilder.java similarity index 78% rename from core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/min/MinBucketPipelineAggregatorBuilder.java rename to core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/min/MinBucketPipelineAggregationBuilder.java index ee7ae9838cc..d20dbe9f7fc 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/min/MinBucketPipelineAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/min/MinBucketPipelineAggregationBuilder.java @@ -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 { +public class MinBucketPipelineAggregationBuilder extends BucketMetricsPipelineAggregationBuilder { 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 pipelineAggregatorFactories) { + List 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 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 other) { + protected boolean innerEquals(BucketMetricsPipelineAggregationBuilder other) { return true; } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/percentile/PercentilesBucketPipelineAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/percentile/PercentilesBucketPipelineAggregationBuilder.java similarity index 83% rename from core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/percentile/PercentilesBucketPipelineAggregatorBuilder.java rename to core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/percentile/PercentilesBucketPipelineAggregationBuilder.java index ddea1a65545..06a1b06dff1 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/percentile/PercentilesBucketPipelineAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/percentile/PercentilesBucketPipelineAggregationBuilder.java @@ -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 { +public class PercentilesBucketPipelineAggregationBuilder + extends BucketMetricsPipelineAggregationBuilder { 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 pipelineAggregatorFactories) { + List 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 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 obj) { - PercentilesBucketPipelineAggregatorBuilder other = (PercentilesBucketPipelineAggregatorBuilder) obj; + protected boolean innerEquals(BucketMetricsPipelineAggregationBuilder obj) { + PercentilesBucketPipelineAggregationBuilder other = (PercentilesBucketPipelineAggregationBuilder) obj; return Objects.deepEquals(percents, other.percents); } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/stats/StatsBucketPipelineAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/stats/StatsBucketPipelineAggregationBuilder.java similarity index 79% rename from core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/stats/StatsBucketPipelineAggregatorBuilder.java rename to core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/stats/StatsBucketPipelineAggregationBuilder.java index a3a37bfe9d6..d3418e897ef 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/stats/StatsBucketPipelineAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/stats/StatsBucketPipelineAggregationBuilder.java @@ -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 { +public class StatsBucketPipelineAggregationBuilder extends BucketMetricsPipelineAggregationBuilder { 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 pipelineAggregatorFactories) { + List 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 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 other) { + protected boolean innerEquals(BucketMetricsPipelineAggregationBuilder other) { return true; } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/stats/extended/ExtendedStatsBucketParser.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/stats/extended/ExtendedStatsBucketParser.java index 5ab1a6afae0..b7fa49267dc 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/stats/extended/ExtendedStatsBucketParser.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/stats/extended/ExtendedStatsBucketParser.java @@ -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 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); diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/stats/extended/ExtendedStatsBucketPipelineAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/stats/extended/ExtendedStatsBucketPipelineAggregationBuilder.java similarity index 81% rename from core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/stats/extended/ExtendedStatsBucketPipelineAggregatorBuilder.java rename to core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/stats/extended/ExtendedStatsBucketPipelineAggregationBuilder.java index 8b17cf7db18..792b9d1f7f1 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/stats/extended/ExtendedStatsBucketPipelineAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/stats/extended/ExtendedStatsBucketPipelineAggregationBuilder.java @@ -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 { +public class ExtendedStatsBucketPipelineAggregationBuilder + extends BucketMetricsPipelineAggregationBuilder { 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 pipelineAggregatorFactories) { + List 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 obj) { - ExtendedStatsBucketPipelineAggregatorBuilder other = (ExtendedStatsBucketPipelineAggregatorBuilder) obj; + protected boolean innerEquals(BucketMetricsPipelineAggregationBuilder obj) { + ExtendedStatsBucketPipelineAggregationBuilder other = (ExtendedStatsBucketPipelineAggregationBuilder) obj; return Objects.equals(sigma, other.sigma); } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/sum/SumBucketPipelineAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/sum/SumBucketPipelineAggregationBuilder.java similarity index 78% rename from core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/sum/SumBucketPipelineAggregatorBuilder.java rename to core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/sum/SumBucketPipelineAggregationBuilder.java index 72ba158a2b2..cf20eaf6e7d 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/sum/SumBucketPipelineAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/sum/SumBucketPipelineAggregationBuilder.java @@ -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 { +public class SumBucketPipelineAggregationBuilder extends BucketMetricsPipelineAggregationBuilder { 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 pipelineAggregatorFactories) { + List 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 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 other) { + protected boolean innerEquals(BucketMetricsPipelineAggregationBuilder other) { return true; } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketscript/BucketScriptPipelineAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketscript/BucketScriptPipelineAggregationBuilder.java similarity index 91% rename from core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketscript/BucketScriptPipelineAggregatorBuilder.java rename to core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketscript/BucketScriptPipelineAggregationBuilder.java index 946c48080db..1e285c24a1f 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketscript/BucketScriptPipelineAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketscript/BucketScriptPipelineAggregationBuilder.java @@ -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 { +public class BucketScriptPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder { 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 bucketsPathsMap, Script script) { + public BucketScriptPipelineAggregationBuilder(String name, Map 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(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); } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketselector/BucketSelectorPipelineAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketselector/BucketSelectorPipelineAggregationBuilder.java similarity index 90% rename from core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketselector/BucketSelectorPipelineAggregatorBuilder.java rename to core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketselector/BucketSelectorPipelineAggregationBuilder.java index 8e1b854b350..9054812ed3f 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketselector/BucketSelectorPipelineAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketselector/BucketSelectorPipelineAggregationBuilder.java @@ -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 { +public class BucketSelectorPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder { 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 bucketsPathsMap, Script script) { + public BucketSelectorPipelineAggregationBuilder(String name, Map 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(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); } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/cumulativesum/CumulativeSumPipelineAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/cumulativesum/CumulativeSumPipelineAggregationBuilder.java similarity index 88% rename from core/src/main/java/org/elasticsearch/search/aggregations/pipeline/cumulativesum/CumulativeSumPipelineAggregatorBuilder.java rename to core/src/main/java/org/elasticsearch/search/aggregations/pipeline/cumulativesum/CumulativeSumPipelineAggregationBuilder.java index a4b2178d0aa..1927317fc2c 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/cumulativesum/CumulativeSumPipelineAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/cumulativesum/CumulativeSumPipelineAggregationBuilder.java @@ -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 { +public class CumulativeSumPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder { 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 pipelineAggregatorFactories) { + List 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); } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/derivative/DerivativePipelineAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/derivative/DerivativePipelineAggregationBuilder.java similarity index 89% rename from core/src/main/java/org/elasticsearch/search/aggregations/pipeline/derivative/DerivativePipelineAggregatorBuilder.java rename to core/src/main/java/org/elasticsearch/search/aggregations/pipeline/derivative/DerivativePipelineAggregationBuilder.java index 0aba20e37c4..5ad2f88b198 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/derivative/DerivativePipelineAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/derivative/DerivativePipelineAggregationBuilder.java @@ -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 { +public class DerivativePipelineAggregationBuilder extends AbstractPipelineAggregationBuilder { 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 pipelineAggregatoractories) { + List 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; } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/MovAvgPipelineAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/MovAvgPipelineAggregationBuilder.java similarity index 92% rename from core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/MovAvgPipelineAggregatorBuilder.java rename to core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/MovAvgPipelineAggregationBuilder.java index 2cf8a1bd046..7d71af17b42 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/MovAvgPipelineAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/MovAvgPipelineAggregationBuilder.java @@ -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 { +public class MovAvgPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder { 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 pipelineAggregatoractories) { + List 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 movingAverageMdelParserRegistry, + public static MovAvgPipelineAggregationBuilder parse( + ParseFieldRegistry 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) diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/models/EwmaModel.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/models/EwmaModel.java index 3248096488f..418930d2465 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/models/EwmaModel.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/models/EwmaModel.java @@ -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(); diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/models/HoltLinearModel.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/models/HoltLinearModel.java index 23eb1fea036..3ebfeb2ce26 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/models/HoltLinearModel.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/models/HoltLinearModel.java @@ -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); diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/models/HoltWintersModel.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/models/HoltWintersModel.java index 43a0be951cc..9249a4c7116 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/models/HoltWintersModel.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/models/HoltWintersModel.java @@ -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); diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/models/LinearModel.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/models/LinearModel.java index 6ce24338917..01ca557ef32 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/models/LinearModel.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/models/LinearModel.java @@ -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; } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/models/SimpleModel.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/models/SimpleModel.java index 4e9e2112947..7a6c72b00dc 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/models/SimpleModel.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/movavg/models/SimpleModel.java @@ -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; } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/serialdiff/SerialDiffPipelineAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/serialdiff/SerialDiffPipelineAggregationBuilder.java similarity index 90% rename from core/src/main/java/org/elasticsearch/search/aggregations/pipeline/serialdiff/SerialDiffPipelineAggregatorBuilder.java rename to core/src/main/java/org/elasticsearch/search/aggregations/pipeline/serialdiff/SerialDiffPipelineAggregationBuilder.java index 5f9096542ea..d671e43045b 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/serialdiff/SerialDiffPipelineAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/serialdiff/SerialDiffPipelineAggregationBuilder.java @@ -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 { +public class SerialDiffPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder { 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); diff --git a/core/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java b/core/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java index b1a5d2d03e6..34b2b536259 100644 --- a/core/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java @@ -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(); } diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/BasePipelineAggregationTestCase.java b/core/src/test/java/org/elasticsearch/search/aggregations/BasePipelineAggregationTestCase.java index 2d3a86fb4be..3e409f3d408 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/BasePipelineAggregationTestCase.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/BasePipelineAggregationTestCase.java @@ -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> extends ESTestCase { +public abstract class BasePipelineAggregationTestCase> 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 { +public class BucketScriptTests extends BasePipelineAggregationTestCase { @Override - protected BucketScriptPipelineAggregatorBuilder createTestAggregatorFactory() { + protected BucketScriptPipelineAggregationBuilder createTestAggregatorFactory() { String name = randomAsciiOfLengthBetween(3, 20); Map bucketsPaths = new HashMap<>(); int numBucketPaths = randomIntBetween(1, 10); @@ -49,7 +49,7 @@ public class BucketScriptTests extends BasePipelineAggregationTestCase { +public class BucketSelectorTests extends BasePipelineAggregationTestCase { @Override - protected BucketSelectorPipelineAggregatorBuilder createTestAggregatorFactory() { + protected BucketSelectorPipelineAggregationBuilder createTestAggregatorFactory() { String name = randomAsciiOfLengthBetween(3, 20); Map bucketsPaths = new HashMap<>(); int numBucketPaths = randomIntBetween(1, 10); @@ -49,7 +49,7 @@ public class BucketSelectorTests extends BasePipelineAggregationTestCase { +public class CumulativeSumTests extends BasePipelineAggregationTestCase { @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)); } diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/DerivativeTests.java b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/DerivativeTests.java index 9ceac7b73a2..678bb0b5c4d 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/DerivativeTests.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/DerivativeTests.java @@ -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 { +public class DerivativeTests extends BasePipelineAggregationTestCase { @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)); } diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/SerialDifferenceTests.java b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/SerialDifferenceTests.java index f7449192d5e..01b31743828 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/SerialDifferenceTests.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/SerialDifferenceTests.java @@ -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 { +public class SerialDifferenceTests extends BasePipelineAggregationTestCase { @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)); } diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/AbstractBucketMetricsTestCase.java b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/AbstractBucketMetricsTestCase.java index 20c4a614ba2..13ed4027b3a 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/AbstractBucketMetricsTestCase.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/AbstractBucketMetricsTestCase.java @@ -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> +public abstract class AbstractBucketMetricsTestCase> extends BasePipelineAggregationTestCase { @Override diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/AvgBucketTests.java b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/AvgBucketTests.java index 86bf5d92aca..5ae06f671f1 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/AvgBucketTests.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/AvgBucketTests.java @@ -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 { +public class AvgBucketTests extends AbstractBucketMetricsTestCase { @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); } diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/ExtendedStatsBucketTests.java b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/ExtendedStatsBucketTests.java index 65e8156f71b..e1441b0dc54 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/ExtendedStatsBucketTests.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/ExtendedStatsBucketTests.java @@ -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 { +public class ExtendedStatsBucketTests extends AbstractBucketMetricsTestCase { @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 { +public class MaxBucketTests extends AbstractBucketMetricsTestCase { @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); } diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/MinBucketTests.java b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/MinBucketTests.java index 4e0befeb4a5..e577e733b4e 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/MinBucketTests.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/MinBucketTests.java @@ -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 { +public class MinBucketTests extends AbstractBucketMetricsTestCase { @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); } diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/PercentilesBucketTests.java b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/PercentilesBucketTests.java index 236f122bdd0..e7c478b23f2 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/PercentilesBucketTests.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/PercentilesBucketTests.java @@ -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 { +public class PercentilesBucketTests extends AbstractBucketMetricsTestCase { @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 { +public class StatsBucketTests extends AbstractBucketMetricsTestCase { @Override - protected StatsBucketPipelineAggregatorBuilder doCreateTestAggregatorFactory(String name, + protected StatsBucketPipelineAggregationBuilder doCreateTestAggregatorFactory(String name, String bucketsPath) { - return new StatsBucketPipelineAggregatorBuilder(name, bucketsPath); + return new StatsBucketPipelineAggregationBuilder(name, bucketsPath); } diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/SumBucketTests.java b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/SumBucketTests.java index 048d26bb612..01ce2277058 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/SumBucketTests.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/SumBucketTests.java @@ -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 { +public class SumBucketTests extends AbstractBucketMetricsTestCase { @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); } diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/moving/avg/MovAvgTests.java b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/moving/avg/MovAvgTests.java index 8aa294e987f..e34a56c496a 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/moving/avg/MovAvgTests.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/moving/avg/MovAvgTests.java @@ -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 { +public class MovAvgTests extends BasePipelineAggregationTestCase { @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 aggregationBuilders; - private List pipelineAggregationBuilders; + private List 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); } }