Skip to content

Commit

Permalink
Remove abstract InternalMetricsAggregation class (elastic#23326)
Browse files Browse the repository at this point in the history
This class doesn't seem to do much other than to group together
certain types of aggregations.
  • Loading branch information
cbuescher authored Feb 23, 2017
1 parent 7e3c06c commit 8b1b152
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 56 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@

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;
import java.util.Objects;

public abstract class InternalNumericMetricsAggregation extends InternalMetricsAggregation {
public abstract class InternalNumericMetricsAggregation extends InternalAggregation {

private static final DocValueFormat DEFAULT_FORMAT = DocValueFormat.RAW;

Expand Down Expand Up @@ -118,7 +119,7 @@ public boolean equals(Object obj) {
return false;
}
InternalNumericMetricsAggregation other = (InternalNumericMetricsAggregation) obj;
return super.equals(obj) &&
return super.equals(obj) &&
Objects.equals(format, other.format);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@
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;
import java.util.Objects;

public class InternalGeoBounds extends InternalMetricsAggregation implements GeoBounds {
public class InternalGeoBounds extends InternalAggregation implements GeoBounds {
final double top;
final double bottom;
final double posLeft;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<Object> aggregation;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,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.Arrays;
Expand All @@ -41,7 +40,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;
Expand Down Expand Up @@ -117,7 +116,7 @@ public InternalAggregation doReduce(List<InternalAggregation> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 */
Expand Down

0 comments on commit 8b1b152

Please sign in to comment.