diff options
author | Luca Cavanna <javanna@users.noreply.github.com> | 2017-04-10 13:35:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-10 13:35:01 +0200 |
commit | 2c545c064d03e92e17d3a75a3181a4da84be0680 (patch) | |
tree | b92d3d4915fc4c6523f69794c007e5beddbf0144 /core/src/test/java/org/elasticsearch/search/aggregations/bucket | |
parent | af49c46b7676de311dc312471fd8c3e12eee39a8 (diff) |
Move getProperty method out of MultiBucketsAggregation.Bucket interface (#23988)
The getProperty method is an internal method needed to run pipeline aggregations and retrieve info by path from the aggs tree. It is not needed in the MultiBucketsAggregation.Bucket interface, which is returned to users running aggregations from the transport client. The method is moved to the InternalMultiBucketAggregation class as that's where it belongs.
Diffstat (limited to 'core/src/test/java/org/elasticsearch/search/aggregations/bucket')
4 files changed, 11 insertions, 11 deletions
diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/bucket/DateHistogramOffsetIT.java b/core/src/test/java/org/elasticsearch/search/aggregations/bucket/DateHistogramOffsetIT.java index dcc80f6990..5e56f75327 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/bucket/DateHistogramOffsetIT.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/bucket/DateHistogramOffsetIT.java @@ -88,7 +88,7 @@ public class DateHistogramOffsetIT extends ESIntegTestCase { assertThat(response.getHits().getTotalHits(), equalTo(5L)); Histogram histo = response.getAggregations().get("date_histo"); - List<Histogram.Bucket> buckets = histo.getBuckets(); + List<? extends Histogram.Bucket> buckets = histo.getBuckets(); assertThat(buckets.size(), equalTo(2)); checkBucketFor(buckets.get(0), new DateTime(2014, 3, 10, 2, 0, DateTimeZone.UTC), 2L); diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/bucket/GeoHashGridIT.java b/core/src/test/java/org/elasticsearch/search/aggregations/bucket/GeoHashGridIT.java index 4cf6cfac9c..7f158e0732 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/bucket/GeoHashGridIT.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/bucket/GeoHashGridIT.java @@ -157,7 +157,7 @@ public class GeoHashGridIT extends ESIntegTestCase { assertSearchResponse(response); GeoHashGrid geoGrid = response.getAggregations().get("geohashgrid"); - List<Bucket> buckets = geoGrid.getBuckets(); + List<? extends Bucket> buckets = geoGrid.getBuckets(); Object[] propertiesKeys = (Object[]) ((InternalAggregation)geoGrid).getProperty("_key"); Object[] propertiesDocCounts = (Object[]) ((InternalAggregation)geoGrid).getProperty("_count"); for (int i = 0; i < buckets.size(); i++) { diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/bucket/HistogramIT.java b/core/src/test/java/org/elasticsearch/search/aggregations/bucket/HistogramIT.java index 444e1568cd..683e792441 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/bucket/HistogramIT.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/bucket/HistogramIT.java @@ -990,7 +990,7 @@ public class HistogramIT extends ESIntegTestCase { assertSearchResponse(r); Histogram histogram = r.getAggregations().get("histo"); - List<Bucket> buckets = histogram.getBuckets(); + List<? extends Bucket> buckets = histogram.getBuckets(); assertEquals(2, buckets.size()); assertEquals(-0.65, (double) buckets.get(0).getKey(), 0.01d); assertEquals(1, buckets.get(0).getDocCount()); diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregatorTests.java b/core/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregatorTests.java index 1ad8f950b9..9d3374630a 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregatorTests.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregatorTests.java @@ -105,7 +105,7 @@ public class DateHistogramAggregatorTests extends AggregatorTestCase { testBothCases(LongPoint.newRangeQuery(INSTANT_FIELD, asLong("2015-01-01"), asLong("2017-12-31")), dataset, aggregation -> aggregation.dateHistogramInterval(DateHistogramInterval.YEAR).field(DATE_FIELD), histogram -> { - List<Histogram.Bucket> buckets = histogram.getBuckets(); + List<? extends Histogram.Bucket> buckets = histogram.getBuckets(); assertEquals(3, buckets.size()); Histogram.Bucket bucket = buckets.get(0); @@ -128,7 +128,7 @@ public class DateHistogramAggregatorTests extends AggregatorTestCase { Arrays.asList("2017-01-01", "2017-02-02", "2017-02-03", "2017-03-04", "2017-03-05", "2017-03-06"), aggregation -> aggregation.dateHistogramInterval(DateHistogramInterval.MONTH).field(DATE_FIELD), histogram -> { - List<Histogram.Bucket> buckets = histogram.getBuckets(); + List<? extends Histogram.Bucket> buckets = histogram.getBuckets(); assertEquals(3, buckets.size()); Histogram.Bucket bucket = buckets.get(0); @@ -159,7 +159,7 @@ public class DateHistogramAggregatorTests extends AggregatorTestCase { ), aggregation -> aggregation.dateHistogramInterval(DateHistogramInterval.DAY).field(DATE_FIELD).minDocCount(1L), histogram -> { - List<Histogram.Bucket> buckets = histogram.getBuckets(); + List<? extends Histogram.Bucket> buckets = histogram.getBuckets(); assertEquals(4, buckets.size()); Histogram.Bucket bucket = buckets.get(0); @@ -197,7 +197,7 @@ public class DateHistogramAggregatorTests extends AggregatorTestCase { ), aggregation -> aggregation.dateHistogramInterval(DateHistogramInterval.HOUR).field(DATE_FIELD).minDocCount(1L), histogram -> { - List<Histogram.Bucket> buckets = histogram.getBuckets(); + List<? extends Histogram.Bucket> buckets = histogram.getBuckets(); assertEquals(6, buckets.size()); Histogram.Bucket bucket = buckets.get(0); @@ -238,7 +238,7 @@ public class DateHistogramAggregatorTests extends AggregatorTestCase { ), aggregation -> aggregation.dateHistogramInterval(DateHistogramInterval.MINUTE).field(DATE_FIELD).minDocCount(1L), histogram -> { - List<Histogram.Bucket> buckets = histogram.getBuckets(); + List<? extends Histogram.Bucket> buckets = histogram.getBuckets(); assertEquals(3, buckets.size()); Histogram.Bucket bucket = buckets.get(0); @@ -268,7 +268,7 @@ public class DateHistogramAggregatorTests extends AggregatorTestCase { ), aggregation -> aggregation.dateHistogramInterval(DateHistogramInterval.SECOND).field(DATE_FIELD).minDocCount(1L), histogram -> { - List<Histogram.Bucket> buckets = histogram.getBuckets(); + List<? extends Histogram.Bucket> buckets = histogram.getBuckets(); assertEquals(3, buckets.size()); Histogram.Bucket bucket = buckets.get(0); @@ -300,7 +300,7 @@ public class DateHistogramAggregatorTests extends AggregatorTestCase { testSearchAndReduceCase(query, timestamps, aggregation -> aggregation.dateHistogramInterval(DateHistogramInterval.seconds(5)).field(DATE_FIELD).minDocCount(0L), histogram -> { - List<Histogram.Bucket> buckets = histogram.getBuckets(); + List<? extends Histogram.Bucket> buckets = histogram.getBuckets(); assertEquals(4, buckets.size()); Histogram.Bucket bucket = buckets.get(0); @@ -325,7 +325,7 @@ public class DateHistogramAggregatorTests extends AggregatorTestCase { testSearchAndReduceCase(query, timestamps, aggregation -> aggregation.dateHistogramInterval(DateHistogramInterval.seconds(5)).field(DATE_FIELD).minDocCount(3L), histogram -> { - List<Histogram.Bucket> buckets = histogram.getBuckets(); + List<? extends Histogram.Bucket> buckets = histogram.getBuckets(); assertEquals(1, buckets.size()); Histogram.Bucket bucket = buckets.get(0); |