diff --git a/core/src/main/java/org/elasticsearch/common/io/stream/NamedWriteableRegistry.java b/core/src/main/java/org/elasticsearch/common/io/stream/NamedWriteableRegistry.java index 5a3de923bde..2e8fe303b29 100644 --- a/core/src/main/java/org/elasticsearch/common/io/stream/NamedWriteableRegistry.java +++ b/core/src/main/java/org/elasticsearch/common/io/stream/NamedWriteableRegistry.java @@ -48,17 +48,6 @@ public class NamedWriteableRegistry { innerRegistry.register(name, reader); } - /** - * Registers a {@link NamedWriteable} prototype given its category. - * @deprecated Prefer {@link #register(Class, String, org.elasticsearch.common.io.stream.Writeable.Reader)} - */ - @Deprecated - @SuppressWarnings("rawtypes") // TODO remove this method entirely before 5.0.0 GA - public synchronized void registerPrototype(Class categoryClass, - NamedWriteable namedWriteable) { - register(categoryClass, namedWriteable.getWriteableName(), namedWriteable::readFrom); - } - /** * Returns a prototype of the {@link NamedWriteable} object identified by the name provided as argument and its category */ diff --git a/core/src/main/java/org/elasticsearch/search/SearchModule.java b/core/src/main/java/org/elasticsearch/search/SearchModule.java index d4112f1ec27..641537d805b 100644 --- a/core/src/main/java/org/elasticsearch/search/SearchModule.java +++ b/core/src/main/java/org/elasticsearch/search/SearchModule.java @@ -381,18 +381,6 @@ public class SearchModule extends AbstractModule { namedWriteableRegistry.register(AggregatorBuilder.class, aggregationName.getPreferredName(), reader); } - /** - * Register an aggregation. - * - * @deprecated prefer {@link #registerPipelineAggregation(Writeable.Reader, PipelineAggregator.Parser, ParseField)}. Will be removed - * before 5.0.0GA. - */ - @Deprecated // NORELEASE remove this before 5.0.0GA - public void registerAggregatorParser(Aggregator.Parser parser) { - aggregationParserRegistry.register(parser, new ParseField(parser.type())); - namedWriteableRegistry.registerPrototype(AggregatorBuilder.class, parser.getFactoryPrototypes()); - } - /** * Register a pipeline aggregation. * @@ -407,18 +395,6 @@ public class SearchModule extends AbstractModule { namedWriteableRegistry.register(PipelineAggregatorBuilder.class, aggregationName.getPreferredName(), reader); } - /** - * Register a pipeline aggregation. - * - * @deprecated prefer {@link #registerPipelineAggregation(Writeable.Reader, PipelineAggregator.Parser, ParseField)}. Will be removed - * before 5.0.0GA. - */ - @Deprecated // NORELEASE remove this before 5.0.0GA - public void registerPipelineParser(PipelineAggregator.Parser parser) { - pipelineAggregationParserRegistry.register(parser, new ParseField(parser.type())); - namedWriteableRegistry.registerPrototype(PipelineAggregatorBuilder.class, parser.getFactoryPrototype()); - } - public AggregatorParsers getAggregatorParsers() { return aggregatorParsers; } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/Aggregator.java b/core/src/main/java/org/elasticsearch/search/aggregations/Aggregator.java index 7204af5357e..a38a1cd3161 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/Aggregator.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/Aggregator.java @@ -46,14 +46,6 @@ public abstract class Aggregator extends BucketCollector implements Releasable { */ @FunctionalInterface public interface Parser { - - /** - * @return The aggregation type this parser is associated with. - */ - default String type() { - throw new UnsupportedOperationException(); // NORELEASE remove before 5.0.0GA - } - /** * Returns the aggregator factory with which this parser is associated, may return {@code null} indicating the * aggregation should be skipped (e.g. when trying to aggregate on unmapped fields). @@ -64,14 +56,6 @@ public abstract class Aggregator extends BucketCollector implements Releasable { * @throws java.io.IOException When parsing fails */ AggregatorBuilder parse(String aggregationName, QueryParseContext context) throws IOException; - - /** - * @return an empty {@link AggregatorBuilder} instance for this parser - * that can be used for deserialization - */ - default AggregatorBuilder getFactoryPrototypes() { - throw new UnsupportedOperationException(); // NORELEASE remove before 5.0.0GA - } } /** diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/AggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/AggregatorBuilder.java index 165f047d252..4d3e859a167 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/AggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/AggregatorBuilder.java @@ -71,39 +71,16 @@ public abstract class AggregatorBuilder> extend metaData = in.readMap(); } - protected boolean usesNewStyleSerialization() { // NORELEASE remove this before 5.0.0GA, when all the aggregations have been migrated - return false; - } - @Override public final void writeTo(StreamOutput out) throws IOException { out.writeString(name); - if (false == usesNewStyleSerialization()) { - doWriteTo(out); - } factoriesBuilder.writeTo(out); out.writeMap(metaData); - if (usesNewStyleSerialization()) { - doWriteTo(out); - } + doWriteTo(out); } protected abstract void doWriteTo(StreamOutput out) throws IOException; - @Override - public final AB readFrom(StreamInput in) throws IOException { - // NORELEASE remove when all aggregations have StreamInput constructor - String name = in.readString(); - AB factory = doReadFrom(name, in); - factory.factoriesBuilder = AggregatorFactories.Builder.PROTOTYPE.readFrom(in); - factory.metaData = in.readMap(); - return factory; - } - - protected AB doReadFrom(String name, StreamInput in) throws IOException { - throw new UnsupportedOperationException(); // NORELEASE remove before 5.0.0GA - } - /** * Add a sub aggregation to this aggregation. */ @@ -188,13 +165,6 @@ public abstract class AggregatorBuilder> extend protected abstract XContentBuilder internalXContent(XContentBuilder builder, Params params) throws IOException; - @Override - public String getWriteableName() { - // NORELEASE remove this before 5.0.0GA - all builders will implement this method on their own. - assert usesNewStyleSerialization() == false: "migrated aggregations should just return their NAME"; - return type.stream().toUtf8(); - } - @Override public int hashCode() { return Objects.hash(factoriesBuilder, metaData, name, type, doHashCode()); diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/InternalAggregation.java b/core/src/main/java/org/elasticsearch/search/aggregations/InternalAggregation.java index 744840b2adf..3604ac97217 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/InternalAggregation.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/InternalAggregation.java @@ -69,7 +69,8 @@ public abstract class InternalAggregation implements Aggregation, ToXContent, St } /** - * @return The name of the type (mainly used for registering the parser for the aggregator (see {@link org.elasticsearch.search.aggregations.Aggregator.Parser#type()}). + * @return The name of the type of aggregation. This is the key for parsing the aggregation from XContent and is the name of the + * aggregation's builder when serialized. */ public String name() { return name; diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/children/ChildrenAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/children/ChildrenAggregatorBuilder.java index 64e5760e4bf..c5982d1000e 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/children/ChildrenAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/children/ChildrenAggregatorBuilder.java @@ -80,11 +80,6 @@ public class ChildrenAggregatorBuilder extends ValuesSourceAggregatorBuilder innerBuild(AggregationContext context, ValuesSourceConfig config, AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException { diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FilterAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FilterAggregatorBuilder.java index 494df6fe539..1c2c6a8d49b 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FilterAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FilterAggregatorBuilder.java @@ -76,11 +76,6 @@ public class FilterAggregatorBuilder extends AggregatorBuilder doBuild(AggregationContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder) throws IOException { diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/filters/FiltersAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/filters/FiltersAggregatorBuilder.java index 004dd503206..6712063c6b8 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/filters/FiltersAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/filters/FiltersAggregatorBuilder.java @@ -128,11 +128,6 @@ public class FiltersAggregatorBuilder extends AggregatorBuilder doBuild(AggregationContext context, AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException { diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/AbstractHistogramBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/AbstractHistogramBuilder.java index 8e8e5ca73e0..632acd1a890 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/AbstractHistogramBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/AbstractHistogramBuilder.java @@ -79,11 +79,6 @@ public abstract class AbstractHistogramBuilder config, AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException { diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/cardinality/CardinalityAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/cardinality/CardinalityAggregatorBuilder.java index 7def3af402a..c9465cfb94d 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/cardinality/CardinalityAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/cardinality/CardinalityAggregatorBuilder.java @@ -66,11 +66,6 @@ public final class CardinalityAggregatorBuilder extends ValuesSourceAggregatorBu } } - @Override - protected boolean usesNewStyleSerialization() { - return true; - } - @Override protected boolean serializeTargetValueType() { return true; diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/geobounds/GeoBoundsAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/geobounds/GeoBoundsAggregatorBuilder.java index a3ee2f43356..ea4681ed686 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/geobounds/GeoBoundsAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/geobounds/GeoBoundsAggregatorBuilder.java @@ -58,11 +58,6 @@ public class GeoBoundsAggregatorBuilder extends ValuesSourceAggregatorBuilder config, AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException { diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/max/MaxAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/max/MaxAggregatorBuilder.java index 3b71dcb6bf5..7258e77aea5 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/max/MaxAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/max/MaxAggregatorBuilder.java @@ -55,11 +55,6 @@ public class MaxAggregatorBuilder extends ValuesSourceAggregatorBuilder.LeafOnly // Do nothing, no extra state to write to stream } - @Override - protected boolean usesNewStyleSerialization() { - return true; - } - @Override protected MaxAggregatorFactory innerBuild(AggregationContext context, ValuesSourceConfig config, AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException { diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/min/MinAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/min/MinAggregatorBuilder.java index 25049bd71b0..c51e97f0538 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/min/MinAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/min/MinAggregatorBuilder.java @@ -55,11 +55,6 @@ public class MinAggregatorBuilder extends ValuesSourceAggregatorBuilder.LeafOnly // Do nothing, no extra state to write to stream } - @Override - protected boolean usesNewStyleSerialization() { - return true; - } - @Override protected MinAggregatorFactory innerBuild(AggregationContext context, ValuesSourceConfig config, AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException { diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/percentiles/PercentileRanksAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/percentiles/PercentileRanksAggregatorBuilder.java index 9124ba23559..58960707b39 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/percentiles/PercentileRanksAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/percentiles/PercentileRanksAggregatorBuilder.java @@ -76,11 +76,6 @@ public class PercentileRanksAggregatorBuilder extends LeafOnlyinit script. */ diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/stats/StatsAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/stats/StatsAggregatorBuilder.java index 6775b9a9610..ab9e4a8d34f 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/stats/StatsAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/stats/StatsAggregatorBuilder.java @@ -61,11 +61,6 @@ public class StatsAggregatorBuilder extends ValuesSourceAggregatorBuilder.LeafOn return new StatsAggregatorFactory(name, type, config, context, parent, subFactoriesBuilder, metaData); } - @Override - protected boolean usesNewStyleSerialization() { - return true; - } - @Override public XContentBuilder doXContentBody(XContentBuilder builder, Params params) throws IOException { return builder; diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/stats/extended/ExtendedStatsAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/stats/extended/ExtendedStatsAggregatorBuilder.java index c5b6c30e494..e6f49d719d6 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/stats/extended/ExtendedStatsAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/stats/extended/ExtendedStatsAggregatorBuilder.java @@ -60,11 +60,6 @@ public class ExtendedStatsAggregatorBuilder out.writeDouble(sigma); } - @Override - protected boolean usesNewStyleSerialization() { - return true; - } - public ExtendedStatsAggregatorBuilder sigma(double sigma) { if (sigma < 0.0) { throw new IllegalArgumentException("[sigma] must be greater than or equal to 0. Found [" + sigma + "] in [" + name + "]"); diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/sum/SumAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/sum/SumAggregatorBuilder.java index 6f83f0f64f1..30246452330 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/sum/SumAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/sum/SumAggregatorBuilder.java @@ -55,11 +55,6 @@ public class SumAggregatorBuilder extends ValuesSourceAggregatorBuilder.LeafOnly // Do nothing, no extra state to write to stream } - @Override - protected boolean usesNewStyleSerialization() { - return true; - } - @Override protected SumAggregatorFactory innerBuild(AggregationContext context, ValuesSourceConfig config, AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException { diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/tophits/TopHitsAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/tophits/TopHitsAggregatorBuilder.java index 932303baa34..9bb6acee2f4 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/tophits/TopHitsAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/tophits/TopHitsAggregatorBuilder.java @@ -156,11 +156,6 @@ public class TopHitsAggregatorBuilder extends AggregatorBuilder0. */ diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/valuecount/ValueCountAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/valuecount/ValueCountAggregatorBuilder.java index 823683e1a89..bfe34f8b3da 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/valuecount/ValueCountAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/valuecount/ValueCountAggregatorBuilder.java @@ -54,11 +54,6 @@ public class ValueCountAggregatorBuilder extends ValuesSourceAggregatorBuilder.L // Do nothing, no extra state to write to stream } - @Override - protected boolean usesNewStyleSerialization() { - return true; - } - @Override protected boolean serializeTargetValueType() { return true; 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 b010b6d28ea..e80a7dbfcf9 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 @@ -39,19 +39,10 @@ public abstract class PipelineAggregator implements Streamable { */ @FunctionalInterface public static interface Parser { - public static final ParseField BUCKETS_PATH = new ParseField("buckets_path"); - public static final ParseField FORMAT = new ParseField("format"); public static final ParseField GAP_POLICY = new ParseField("gap_policy"); - /** - * @return The aggregation type this parser is associated with. - */ - default String type() { - throw new UnsupportedOperationException(); // NORELEASE remove before 5.0.0GA - } - /** * Returns the pipeline aggregator factory with which this parser is * associated. @@ -66,15 +57,6 @@ public abstract class PipelineAggregator implements Streamable { */ PipelineAggregatorBuilder parse(String pipelineAggregatorName, QueryParseContext context) throws IOException; - - /** - * @return an empty {@link PipelineAggregatorBuilder} instance for this - * parser that can be used for deserialization - */ - default PipelineAggregatorBuilder getFactoryPrototype() { - throw new UnsupportedOperationException(); // NORELEASE remove before 5.0.0GA - } - } private String name; diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/PipelineAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/PipelineAggregatorBuilder.java index 08e1b19ca07..6e9a1919428 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/PipelineAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/PipelineAggregatorBuilder.java @@ -86,34 +86,12 @@ public abstract class PipelineAggregatorBuilder readFrom(StreamInput in) throws IOException { - String name = in.readString(); - String[] bucketsPaths = in.readStringArray(); - PipelineAggregatorBuilder factory = doReadFrom(name, bucketsPaths, in); - factory.metaData = in.readMap(); - return factory; - } - - protected PipelineAggregatorBuilder doReadFrom(String name, String[] bucketsPaths, StreamInput in) throws IOException { - throw new UnsupportedOperationException(); // NORELEASE remove this before 5.0.0GA, when all the aggregations have been migrated - } - public String name() { return name; } @@ -161,12 +139,6 @@ public abstract class PipelineAggregatorBuilder doReadFrom(String name, String[] bucketsPaths, StreamInput in) throws IOException { - BucketMetricsPipelineAggregatorBuilder factory = innerReadFrom(name, bucketsPaths, in); - factory.format = in.readOptionalString(); - factory.gapPolicy = GapPolicy.readFrom(in); - return factory; - } - - protected BucketMetricsPipelineAggregatorBuilder innerReadFrom(String name, String[] bucketsPaths, StreamInput in) - throws IOException { - throw new UnsupportedOperationException(); // NORELEASE remove before 5.0.0 GA - } - - /** * Sets the format to use on the output of this aggregation. */ 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/AvgBucketPipelineAggregatorBuilder.java index 49ea65d3310..3435c9768b0 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/AvgBucketPipelineAggregatorBuilder.java @@ -53,11 +53,6 @@ public class AvgBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAgg // Do nothing, no extra state to write to stream } - @Override - protected boolean usesNewStyleSerialization() { - return true; - } - @Override protected PipelineAggregator createInternal(Map metaData) throws IOException { return new AvgBucketPipelineAggregator(name, bucketsPaths, gapPolicy(), formatter(), metaData); 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/MaxBucketPipelineAggregatorBuilder.java index acd587b5026..56ae7d76302 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/MaxBucketPipelineAggregatorBuilder.java @@ -53,11 +53,6 @@ public class MaxBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAgg // Do nothing, no extra state to write to stream } - @Override - protected boolean usesNewStyleSerialization() { - return true; - } - @Override protected PipelineAggregator createInternal(Map metaData) throws IOException { return new MaxBucketPipelineAggregator(name, bucketsPaths, gapPolicy(), formatter(), metaData); 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/MinBucketPipelineAggregatorBuilder.java index 9b5ff99f8be..de4df9fac70 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/MinBucketPipelineAggregatorBuilder.java @@ -53,11 +53,6 @@ public class MinBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAgg // Do nothing, no extra state to write to stream } - @Override - protected boolean usesNewStyleSerialization() { - return true; - } - @Override protected PipelineAggregator createInternal(Map metaData) throws IOException { return new MinBucketPipelineAggregator(name, bucketsPaths, gapPolicy(), formatter(), metaData); 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/PercentilesBucketPipelineAggregatorBuilder.java index 9c6faa0dd99..515e032da4f 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/PercentilesBucketPipelineAggregatorBuilder.java @@ -63,11 +63,6 @@ public class PercentilesBucketPipelineAggregatorBuilder out.writeDoubleArray(percents); } - @Override - protected boolean usesNewStyleSerialization() { - return true; - } - /** * Get the percentages to calculate percentiles for in this aggregation */ 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/StatsBucketPipelineAggregatorBuilder.java index 37ba5e3c1f0..f56e28d988f 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/StatsBucketPipelineAggregatorBuilder.java @@ -55,11 +55,6 @@ public class StatsBucketPipelineAggregatorBuilder extends BucketMetricsPipelineA // Do nothing, no extra state to write to stream } - @Override - protected boolean usesNewStyleSerialization() { - return true; - } - @Override protected PipelineAggregator createInternal(Map metaData) throws IOException { return new StatsBucketPipelineAggregator(name, bucketsPaths, gapPolicy(), formatter(), metaData); 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/ExtendedStatsBucketPipelineAggregatorBuilder.java index 8856def6741..b27ce374978 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/ExtendedStatsBucketPipelineAggregatorBuilder.java @@ -58,11 +58,6 @@ public class ExtendedStatsBucketPipelineAggregatorBuilder out.writeDouble(sigma); } - @Override - protected boolean usesNewStyleSerialization() { - return true; - } - /** * Set the value of sigma to use when calculating the standard deviation * bounds 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/SumBucketPipelineAggregatorBuilder.java index d322b25884c..0243de20916 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/SumBucketPipelineAggregatorBuilder.java @@ -53,11 +53,6 @@ public class SumBucketPipelineAggregatorBuilder extends BucketMetricsPipelineAgg // Do nothing, no extra state to write to stream } - @Override - protected boolean usesNewStyleSerialization() { - return true; - } - @Override protected PipelineAggregator createInternal(Map metaData) throws IOException { return new SumBucketPipelineAggregator(name, bucketsPaths, gapPolicy(), formatter(), metaData); 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/BucketScriptPipelineAggregatorBuilder.java index ee0e915d7d6..773eb372dce 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/BucketScriptPipelineAggregatorBuilder.java @@ -93,11 +93,6 @@ public class BucketScriptPipelineAggregatorBuilder extends PipelineAggregatorBui gapPolicy.writeTo(out); } - @Override - protected boolean usesNewStyleSerialization() { - return true; - } - private static Map convertToBucketsPathMap(String[] bucketsPaths) { Map bucketsPathsMap = new HashMap<>(); for (int i = 0; i < bucketsPaths.length; i++) { 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/BucketSelectorPipelineAggregatorBuilder.java index b45e28b9d23..aa9b41d42b6 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/BucketSelectorPipelineAggregatorBuilder.java @@ -88,11 +88,6 @@ public class BucketSelectorPipelineAggregatorBuilder extends PipelineAggregatorB gapPolicy.writeTo(out); } - @Override - protected boolean usesNewStyleSerialization() { - return true; - } - private static Map convertToBucketsPathMap(String[] bucketsPaths) { Map bucketsPathsMap = new HashMap<>(); for (int i = 0; i < bucketsPaths.length; i++) { 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/CumulativeSumPipelineAggregatorBuilder.java index 23195401f9c..7f2208c5480 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/CumulativeSumPipelineAggregatorBuilder.java @@ -65,11 +65,6 @@ public class CumulativeSumPipelineAggregatorBuilder extends PipelineAggregatorBu out.writeOptionalString(format); } - @Override - protected boolean usesNewStyleSerialization() { - return true; - } - /** * Sets the format to use on the output of this aggregation. */ 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/DerivativePipelineAggregatorBuilder.java index 65d11681077..ea75dee3d14 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/DerivativePipelineAggregatorBuilder.java @@ -86,11 +86,6 @@ public class DerivativePipelineAggregatorBuilder extends PipelineAggregatorBuild out.writeOptionalString(units); } - @Override - protected boolean usesNewStyleSerialization() { - return true; - } - public DerivativePipelineAggregatorBuilder format(String format) { if (format == null) { throw new IllegalArgumentException("[format] must not be null: [" + name + "]"); 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/MovAvgPipelineAggregatorBuilder.java index d9b66aa2175..383522d4fb5 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/MovAvgPipelineAggregatorBuilder.java @@ -93,11 +93,6 @@ public class MovAvgPipelineAggregatorBuilder extends PipelineAggregatorBuilder valueType = ValueType.resolveForScript(parser.text()); if (targetValueType != null && valueType.isNotA(targetValueType)) { throw new ParsingException(parser.getTokenLocation(), - type() + " aggregation [" + aggregationName + "] was configured with an incompatible value type [" - + valueType + "]. [" + type() + "] aggregation can only work on value of type [" + "Aggregation [" + aggregationName + "] was configured with an incompatible value type [" + + valueType + "]. It can only work on value of type [" + targetValueType + "]"); } } else if (!token(aggregationName, currentFieldName, token, parser, context.getParseFieldMatcher(), otherOptions)) { diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/support/ValuesSourceAggregatorBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/support/ValuesSourceAggregatorBuilder.java index eb1ced0b91b..ee2b0a35405 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/support/ValuesSourceAggregatorBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/support/ValuesSourceAggregatorBuilder.java @@ -140,18 +140,8 @@ public abstract class ValuesSourceAggregatorBuilder factory = innerReadFrom(name, valuesSourceType, targetValueType, in); - factory.field = in.readOptionalString(); - if (in.readBoolean()) { - factory.script = Script.readScript(in); - } - if (in.readBoolean()) { - factory.valueType = ValueType.readFromStream(in); - } - factory.format = in.readOptionalString(); - factory.missing = in.readGenericValue(); - if (in.readBoolean()) { - factory.timeZone = DateTimeZone.forID(in.readString()); - } - return (AB) factory; - } - - protected ValuesSourceAggregatorBuilder innerReadFrom(String name, ValuesSourceType valuesSourceType, - ValueType targetValueType, StreamInput in) throws IOException { - throw new UnsupportedOperationException(); // NORELEASE remove when no longer overridden - } - /** * Should this builder serialize its targetValueType? Defaults to false. All subclasses that override this to true should use the three * argument read constructor rather than the four argument version.