Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we remove abstract InternalMetricsAggregation? #23326

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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