From 3201e2271032e348d82c0725b381066e149a0e37 Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Wed, 10 May 2017 14:05:43 +0200 Subject: [PATCH] Fix merging conflicts --- .../aggregations/InternalAggregation.java | 2 +- .../search/aggregations/ParsedAggregation.java | 2 +- .../bucket/histogram/ParsedDateHistogram.java | 2 +- .../bucket/histogram/ParsedHistogram.java | 2 +- .../bucket/sampler/InternalSampler.java | 2 +- .../significant/UnmappedSignificantTerms.java | 2 +- .../bucket/terms/ParsedDoubleTerms.java | 2 +- .../bucket/terms/ParsedLongTerms.java | 2 +- .../bucket/terms/ParsedStringTerms.java | 2 +- .../bucket/terms/UnmappedTerms.java | 2 +- .../aggregations/metrics/avg/ParsedAvg.java | 2 +- .../metrics/cardinality/ParsedCardinality.java | 2 +- .../metrics/geocentroid/ParsedGeoCentroid.java | 2 +- .../aggregations/metrics/max/ParsedMax.java | 2 +- .../aggregations/metrics/min/ParsedMin.java | 2 +- .../hdr/ParsedHDRPercentileRanks.java | 2 +- .../percentiles/hdr/ParsedHDRPercentiles.java | 2 +- .../tdigest/ParsedTDigestPercentileRanks.java | 2 +- .../tdigest/ParsedTDigestPercentiles.java | 2 +- .../metrics/stats/ParsedStats.java | 2 +- .../stats/extended/ParsedExtendedStats.java | 2 +- .../aggregations/metrics/sum/ParsedSum.java | 2 +- .../metrics/valuecount/ParsedValueCount.java | 2 +- .../pipeline/ParsedSimpleValue.java | 2 +- .../bucketmetrics/ParsedBucketMetricValue.java | 2 +- .../bucketmetrics/stats/ParsedStatsBucket.java | 2 +- .../extended/ParsedExtendedStatsBucket.java | 2 +- .../pipeline/derivative/ParsedDerivative.java | 2 +- .../search/aggregations/AggregationsTests.java | 1 + ...InternalMultiBucketAggregationTestCase.java | 1 + .../aggregations/ParsedAggregationTests.java | 4 ++-- .../metrics/avg/InternalAvgTests.java | 2 +- .../AbstractPercentilesTestCase.java | 2 +- .../InternalTDigestPercentilesRanksTests.java | 2 +- .../InternalBucketMetricValueTests.java | 2 +- .../test/InternalAggregationTestCase.java | 18 +++++++++++++++--- 36 files changed, 51 insertions(+), 37 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/InternalAggregation.java b/core/src/main/java/org/elasticsearch/search/aggregations/InternalAggregation.java index 0618e5cb29d..c86d8afed5b 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/InternalAggregation.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/InternalAggregation.java @@ -174,7 +174,7 @@ public abstract class InternalAggregation implements Aggregation, ToXContent, Na * the aggregation name in the response, so that it can later be used by REST clients * to determine the internal type of the aggregation. */ - protected String getType() { + public String getType() { return getWriteableName(); } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/ParsedAggregation.java b/core/src/main/java/org/elasticsearch/search/aggregations/ParsedAggregation.java index 6942b6aec5d..3ff91d8d36d 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/ParsedAggregation.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/ParsedAggregation.java @@ -63,7 +63,7 @@ public abstract class ParsedAggregation implements Aggregation, ToXContent { * to determine the internal type of the aggregation. */ //TODO it may make sense to move getType to the Aggregation interface given that we are duplicating it in both implementations - protected abstract String getType(); + public abstract String getType(); @Override public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException { diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedDateHistogram.java b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedDateHistogram.java index 9efc478aff1..ace0cb59907 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedDateHistogram.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedDateHistogram.java @@ -32,7 +32,7 @@ import java.util.List; public class ParsedDateHistogram extends ParsedMultiBucketAggregation implements Histogram { @Override - protected String getType() { + public String getType() { return DateHistogramAggregationBuilder.NAME; } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedHistogram.java b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedHistogram.java index eeec1cd81ba..6037c155886 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedHistogram.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedHistogram.java @@ -29,7 +29,7 @@ import java.util.List; public class ParsedHistogram extends ParsedMultiBucketAggregation implements Histogram { @Override - protected String getType() { + public String getType() { return HistogramAggregationBuilder.NAME; } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/InternalSampler.java b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/InternalSampler.java index 0c02f1ae935..3b5b42d59fd 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/InternalSampler.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/InternalSampler.java @@ -48,7 +48,7 @@ public class InternalSampler extends InternalSingleBucketAggregation implements } @Override - protected String getType() { + public String getType() { return "sampler"; } diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/significant/UnmappedSignificantTerms.java b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/significant/UnmappedSignificantTerms.java index f9d8375af8c..e79b01abe4b 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/significant/UnmappedSignificantTerms.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/significant/UnmappedSignificantTerms.java @@ -76,7 +76,7 @@ public class UnmappedSignificantTerms extends InternalSignificantTerms private final NamedXContentRegistry namedXContentRegistry = new NamedXContentRegistry(getNamedXContents()); - static List getNamedXContents() { + public static List getNamedXContents() { Map> namedXContents = new HashMap<>(); namedXContents.put(CardinalityAggregationBuilder.NAME, (p, c) -> ParsedCardinality.fromXContent(p, (String) c)); namedXContents.put(InternalHDRPercentiles.NAME, (p, c) -> ParsedHDRPercentiles.fromXContent(p, (String) c)); @@ -184,7 +196,7 @@ public abstract class InternalAggregationTestCase protected abstract void assertReduced(T reduced, List inputs); @Override - protected final T createTestInstance() { + public final T createTestInstance() { return createTestInstance(randomAlphaOfLength(5)); }