diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalMetricsAggregation.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalMetricsAggregation.java deleted file mode 100644 index ded69d9f75bfb..0000000000000 --- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalMetricsAggregation.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.elasticsearch.search.aggregations.metrics; - -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.search.aggregations.InternalAggregation; -import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; - -import java.io.IOException; -import java.util.List; -import java.util.Map; - -public abstract class InternalMetricsAggregation extends InternalAggregation { - protected InternalMetricsAggregation(String name, List pipelineAggregators, Map metaData) { - super(name, pipelineAggregators, metaData); - } - - /** - * Read from a stream. - */ - protected InternalMetricsAggregation(StreamInput in) throws IOException { - super(in); - } - -} diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalNumericMetricsAggregation.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalNumericMetricsAggregation.java index 901c52a232d22..b5d1eeddae9d8 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalNumericMetricsAggregation.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalNumericMetricsAggregation.java @@ -20,16 +20,14 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.search.DocValueFormat; +import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; import java.io.IOException; import java.util.List; import java.util.Map; -/** - * - */ -public abstract class InternalNumericMetricsAggregation extends InternalMetricsAggregation { +public abstract class InternalNumericMetricsAggregation extends InternalAggregation { private static final DocValueFormat DEFAULT_FORMAT = DocValueFormat.RAW; diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/geobounds/InternalGeoBounds.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/geobounds/InternalGeoBounds.java index 5a9df082965d4..7ec0f3fe8a8b8 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/geobounds/InternalGeoBounds.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/geobounds/InternalGeoBounds.java @@ -24,14 +24,13 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.InternalAggregation; -import org.elasticsearch.search.aggregations.metrics.InternalMetricsAggregation; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; import java.io.IOException; import java.util.List; import java.util.Map; -public class InternalGeoBounds extends InternalMetricsAggregation implements GeoBounds { +public class InternalGeoBounds extends InternalAggregation implements GeoBounds { private final double top; private final double bottom; private final double posLeft; @@ -82,7 +81,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { public String getWriteableName() { return GeoBoundsAggregationBuilder.NAME; } - + @Override public InternalAggregation doReduce(List aggregations, ReduceContext reduceContext) { double top = Double.NEGATIVE_INFINITY; @@ -187,21 +186,21 @@ public XContentBuilder doXContentBody(XContentBuilder builder, Params params) th private static class BoundingBox { private final GeoPoint topLeft; private final GeoPoint bottomRight; - + BoundingBox(GeoPoint topLeft, GeoPoint bottomRight) { this.topLeft = topLeft; this.bottomRight = bottomRight; } - + public GeoPoint topLeft() { return topLeft; } - + public GeoPoint bottomRight() { return bottomRight; } } - + private BoundingBox resolveBoundingBox() { if (Double.isInfinite(top)) { return null; diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/geocentroid/InternalGeoCentroid.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/geocentroid/InternalGeoCentroid.java index 06d9d369029af..a5a8058ed2835 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/geocentroid/InternalGeoCentroid.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/geocentroid/InternalGeoCentroid.java @@ -25,7 +25,6 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.InternalAggregation; -import org.elasticsearch.search.aggregations.metrics.InternalMetricsAggregation; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; import java.io.IOException; @@ -35,7 +34,7 @@ /** * Serialization and merge logic for {@link GeoCentroidAggregator}. */ -public class InternalGeoCentroid extends InternalMetricsAggregation implements GeoCentroid { +public class InternalGeoCentroid extends InternalAggregation implements GeoCentroid { protected final GeoPoint centroid; protected final long count; diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/scripted/InternalScriptedMetric.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/scripted/InternalScriptedMetric.java index 174ff8ca28dc1..bb8e1ac48d399 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/scripted/InternalScriptedMetric.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/scripted/InternalScriptedMetric.java @@ -27,7 +27,6 @@ import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptContext; import org.elasticsearch.search.aggregations.InternalAggregation; -import org.elasticsearch.search.aggregations.metrics.InternalMetricsAggregation; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; import java.io.IOException; @@ -37,7 +36,7 @@ import java.util.List; import java.util.Map; -public class InternalScriptedMetric extends InternalMetricsAggregation implements ScriptedMetric { +public class InternalScriptedMetric extends InternalAggregation implements ScriptedMetric { private final Script reduceScript; private final List aggregation; diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/tophits/InternalTopHits.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/tophits/InternalTopHits.java index e4d161ae54c51..6617b4f7c4694 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/tophits/InternalTopHits.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/tophits/InternalTopHits.java @@ -26,11 +26,10 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHits; import org.elasticsearch.search.aggregations.InternalAggregation; -import org.elasticsearch.search.aggregations.metrics.InternalMetricsAggregation; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; -import org.elasticsearch.search.SearchHit; import java.io.IOException; import java.util.List; @@ -39,7 +38,7 @@ /** * Results of the {@link TopHitsAggregator}. */ -public class InternalTopHits extends InternalMetricsAggregation implements TopHits { +public class InternalTopHits extends InternalAggregation implements TopHits { private int from; private int size; private TopDocs topDocs; @@ -107,7 +106,7 @@ public InternalAggregation doReduce(List aggregations, Redu shardDocs = new TopFieldDocs[aggregations.size()]; for (int i = 0; i < shardDocs.length; i++) { InternalTopHits topHitsAgg = (InternalTopHits) aggregations.get(i); - shardDocs[i] = (TopFieldDocs) topHitsAgg.topDocs; + shardDocs[i] = topHitsAgg.topDocs; shardHits[i] = topHitsAgg.searchHits; } reducedTopDocs = TopDocs.merge(sort, from, size, (TopFieldDocs[]) shardDocs); diff --git a/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/InternalMatrixStats.java b/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/InternalMatrixStats.java index d97fb64a16d70..0914ea2910c2b 100644 --- a/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/InternalMatrixStats.java +++ b/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/InternalMatrixStats.java @@ -22,7 +22,6 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.InternalAggregation; -import org.elasticsearch.search.aggregations.metrics.InternalMetricsAggregation; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; import java.io.IOException; @@ -35,7 +34,7 @@ /** * Computes distribution statistics over multiple fields */ -public class InternalMatrixStats extends InternalMetricsAggregation implements MatrixStats { +public class InternalMatrixStats extends InternalAggregation implements MatrixStats { /** per shard stats needed to compute stats */ private final RunningStats stats; /** final result */