Skip to content

Commit 638c86c

Browse files
Remove duplicated methods (#116337)
Looks like there are two code-paths that do the same thing. This removal just gets rid of one of them.
1 parent bcd6c1d commit 638c86c

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalGeoCentroid.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
import org.elasticsearch.common.geo.SpatialPoint;
1414
import org.elasticsearch.common.io.stream.StreamInput;
1515
import org.elasticsearch.common.io.stream.StreamOutput;
16-
import org.elasticsearch.search.aggregations.InternalAggregation;
17-
import org.elasticsearch.search.aggregations.support.SamplingContext;
1816

1917
import java.io.IOException;
2018
import java.util.Map;
@@ -94,9 +92,4 @@ protected String nameSecond() {
9492
protected double extractSecond(SpatialPoint point) {
9593
return point.getX();
9694
}
97-
98-
@Override
99-
public InternalAggregation finalizeSampling(SamplingContext samplingContext) {
100-
return new InternalGeoCentroid(name, centroid, samplingContext.scaleUp(count), getMetadata());
101-
}
10295
}

x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/metrics/InternalCartesianCentroid.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
import org.elasticsearch.common.geo.SpatialPoint;
1111
import org.elasticsearch.common.io.stream.StreamInput;
1212
import org.elasticsearch.common.io.stream.StreamOutput;
13-
import org.elasticsearch.search.aggregations.InternalAggregation;
1413
import org.elasticsearch.search.aggregations.metrics.InternalCentroid;
15-
import org.elasticsearch.search.aggregations.support.SamplingContext;
1614
import org.elasticsearch.xpack.spatial.common.CartesianPoint;
1715

1816
import java.io.IOException;
@@ -74,11 +72,6 @@ protected InternalCartesianCentroid copyWith(double firstSum, double secondSum,
7472
return copyWith(result, totalCount);
7573
}
7674

77-
@Override
78-
public InternalAggregation finalizeSampling(SamplingContext samplingContext) {
79-
return new InternalCartesianCentroid(name, centroid, samplingContext.scaleUp(count), getMetadata());
80-
}
81-
8275
@Override
8376
protected String nameFirst() {
8477
return "x";

0 commit comments

Comments
 (0)