Fix merging conflicts

This commit is contained in:
Tanguy Leroux 2017-05-10 14:05:43 +02:00
parent bf718a686f
commit 3201e22710
36 changed files with 51 additions and 37 deletions

View File

@ -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 * the aggregation name in the response, so that it can later be used by REST clients
* to determine the internal type of the aggregation. * to determine the internal type of the aggregation.
*/ */
protected String getType() { public String getType() {
return getWriteableName(); return getWriteableName();
} }

View File

@ -63,7 +63,7 @@ public abstract class ParsedAggregation implements Aggregation, ToXContent {
* to determine the internal type of the aggregation. * 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 //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 @Override
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException { public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException {

View File

@ -32,7 +32,7 @@ import java.util.List;
public class ParsedDateHistogram extends ParsedMultiBucketAggregation<ParsedDateHistogram.ParsedBucket> implements Histogram { public class ParsedDateHistogram extends ParsedMultiBucketAggregation<ParsedDateHistogram.ParsedBucket> implements Histogram {
@Override @Override
protected String getType() { public String getType() {
return DateHistogramAggregationBuilder.NAME; return DateHistogramAggregationBuilder.NAME;
} }

View File

@ -29,7 +29,7 @@ import java.util.List;
public class ParsedHistogram extends ParsedMultiBucketAggregation<ParsedHistogram.ParsedBucket> implements Histogram { public class ParsedHistogram extends ParsedMultiBucketAggregation<ParsedHistogram.ParsedBucket> implements Histogram {
@Override @Override
protected String getType() { public String getType() {
return HistogramAggregationBuilder.NAME; return HistogramAggregationBuilder.NAME;
} }

View File

@ -48,7 +48,7 @@ public class InternalSampler extends InternalSingleBucketAggregation implements
} }
@Override @Override
protected String getType() { public String getType() {
return "sampler"; return "sampler";
} }

View File

@ -76,7 +76,7 @@ public class UnmappedSignificantTerms extends InternalSignificantTerms<UnmappedS
} }
@Override @Override
protected String getType() { public String getType() {
return SignificantStringTerms.NAME; return SignificantStringTerms.NAME;
} }

View File

@ -28,7 +28,7 @@ import java.io.IOException;
public class ParsedDoubleTerms extends ParsedTerms { public class ParsedDoubleTerms extends ParsedTerms {
@Override @Override
protected String getType() { public String getType() {
return DoubleTerms.NAME; return DoubleTerms.NAME;
} }

View File

@ -28,7 +28,7 @@ import java.io.IOException;
public class ParsedLongTerms extends ParsedTerms { public class ParsedLongTerms extends ParsedTerms {
@Override @Override
protected String getType() { public String getType() {
return LongTerms.NAME; return LongTerms.NAME;
} }

View File

@ -29,7 +29,7 @@ import java.io.IOException;
public class ParsedStringTerms extends ParsedTerms { public class ParsedStringTerms extends ParsedTerms {
@Override @Override
protected String getType() { public String getType() {
return StringTerms.NAME; return StringTerms.NAME;
} }

View File

@ -73,7 +73,7 @@ public class UnmappedTerms extends InternalTerms<UnmappedTerms, UnmappedTerms.Bu
} }
@Override @Override
protected String getType() { public String getType() {
return StringTerms.NAME; return StringTerms.NAME;
} }

View File

@ -34,7 +34,7 @@ public class ParsedAvg extends ParsedSingleValueNumericMetricsAggregation implem
} }
@Override @Override
protected String getType() { public String getType() {
return AvgAggregationBuilder.NAME; return AvgAggregationBuilder.NAME;
} }

View File

@ -50,7 +50,7 @@ public class ParsedCardinality extends ParsedAggregation implements Cardinality
} }
@Override @Override
protected String getType() { public String getType() {
return CardinalityAggregationBuilder.NAME; return CardinalityAggregationBuilder.NAME;
} }

View File

@ -46,7 +46,7 @@ public class ParsedGeoCentroid extends ParsedAggregation implements GeoCentroid
} }
@Override @Override
protected String getType() { public String getType() {
return GeoCentroidAggregationBuilder.NAME; return GeoCentroidAggregationBuilder.NAME;
} }

View File

@ -34,7 +34,7 @@ public class ParsedMax extends ParsedSingleValueNumericMetricsAggregation implem
} }
@Override @Override
protected String getType() { public String getType() {
return MaxAggregationBuilder.NAME; return MaxAggregationBuilder.NAME;
} }

View File

@ -34,7 +34,7 @@ public class ParsedMin extends ParsedSingleValueNumericMetricsAggregation implem
} }
@Override @Override
protected String getType() { public String getType() {
return MinAggregationBuilder.NAME; return MinAggregationBuilder.NAME;
} }

View File

@ -31,7 +31,7 @@ import java.util.Iterator;
public class ParsedHDRPercentileRanks extends ParsedPercentileRanks { public class ParsedHDRPercentileRanks extends ParsedPercentileRanks {
@Override @Override
protected String getType() { public String getType() {
return InternalHDRPercentileRanks.NAME; return InternalHDRPercentileRanks.NAME;
} }

View File

@ -29,7 +29,7 @@ import java.io.IOException;
public class ParsedHDRPercentiles extends ParsedPercentiles implements Percentiles { public class ParsedHDRPercentiles extends ParsedPercentiles implements Percentiles {
@Override @Override
protected String getType() { public String getType() {
return InternalHDRPercentiles.NAME; return InternalHDRPercentiles.NAME;
} }

View File

@ -31,7 +31,7 @@ import java.util.Iterator;
public class ParsedTDigestPercentileRanks extends ParsedPercentileRanks { public class ParsedTDigestPercentileRanks extends ParsedPercentileRanks {
@Override @Override
protected String getType() { public String getType() {
return InternalTDigestPercentileRanks.NAME; return InternalTDigestPercentileRanks.NAME;
} }

View File

@ -29,7 +29,7 @@ import java.io.IOException;
public class ParsedTDigestPercentiles extends ParsedPercentiles implements Percentiles { public class ParsedTDigestPercentiles extends ParsedPercentiles implements Percentiles {
@Override @Override
protected String getType() { public String getType() {
return InternalTDigestPercentiles.NAME; return InternalTDigestPercentiles.NAME;
} }

View File

@ -87,7 +87,7 @@ public class ParsedStats extends ParsedAggregation implements Stats {
} }
@Override @Override
protected String getType() { public String getType() {
return StatsAggregationBuilder.NAME; return StatsAggregationBuilder.NAME;
} }

View File

@ -44,7 +44,7 @@ public class ParsedExtendedStats extends ParsedStats implements ExtendedStats {
protected double avg; protected double avg;
@Override @Override
protected String getType() { public String getType() {
return ExtendedStatsAggregationBuilder.NAME; return ExtendedStatsAggregationBuilder.NAME;
} }

View File

@ -34,7 +34,7 @@ public class ParsedSum extends ParsedSingleValueNumericMetricsAggregation implem
} }
@Override @Override
protected String getType() { public String getType() {
return SumAggregationBuilder.NAME; return SumAggregationBuilder.NAME;
} }

View File

@ -48,7 +48,7 @@ public class ParsedValueCount extends ParsedAggregation implements ValueCount {
} }
@Override @Override
protected String getType() { public String getType() {
return ValueCountAggregationBuilder.NAME; return ValueCountAggregationBuilder.NAME;
} }

View File

@ -29,7 +29,7 @@ import java.io.IOException;
public class ParsedSimpleValue extends ParsedSingleValueNumericMetricsAggregation implements SimpleValue { public class ParsedSimpleValue extends ParsedSingleValueNumericMetricsAggregation implements SimpleValue {
@Override @Override
protected String getType() { public String getType() {
return InternalSimpleValue.NAME; return InternalSimpleValue.NAME;
} }

View File

@ -38,7 +38,7 @@ public class ParsedBucketMetricValue extends ParsedSingleValueNumericMetricsAggr
} }
@Override @Override
protected String getType() { public String getType() {
return InternalBucketMetricValue.NAME; return InternalBucketMetricValue.NAME;
} }

View File

@ -27,7 +27,7 @@ import org.elasticsearch.search.aggregations.metrics.stats.ParsedStats;
public class ParsedStatsBucket extends ParsedStats implements StatsBucket { public class ParsedStatsBucket extends ParsedStats implements StatsBucket {
@Override @Override
protected String getType() { public String getType() {
return StatsBucketPipelineAggregationBuilder.NAME; return StatsBucketPipelineAggregationBuilder.NAME;
} }

View File

@ -27,7 +27,7 @@ import org.elasticsearch.search.aggregations.metrics.stats.extended.ParsedExtend
public class ParsedExtendedStatsBucket extends ParsedExtendedStats implements ExtendedStatsBucket { public class ParsedExtendedStatsBucket extends ParsedExtendedStats implements ExtendedStatsBucket {
@Override @Override
protected String getType() { public String getType() {
return ExtendedStatsBucketPipelineAggregationBuilder.NAME; return ExtendedStatsBucketPipelineAggregationBuilder.NAME;
} }

View File

@ -42,7 +42,7 @@ public class ParsedDerivative extends ParsedSimpleValue implements Derivative {
} }
@Override @Override
protected String getType() { public String getType() {
return DerivativePipelineAggregationBuilder.NAME; return DerivativePipelineAggregationBuilder.NAME;
} }

View File

@ -53,6 +53,7 @@ import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.percentile.I
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.extended.InternalExtendedStatsBucketTests; import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.extended.InternalExtendedStatsBucketTests;
import org.elasticsearch.search.aggregations.pipeline.derivative.InternalDerivativeTests; import org.elasticsearch.search.aggregations.pipeline.derivative.InternalDerivativeTests;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.InternalAggregationTestCase;
import org.elasticsearch.test.hamcrest.ElasticsearchAssertions; import org.elasticsearch.test.hamcrest.ElasticsearchAssertions;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;

View File

@ -21,6 +21,7 @@ package org.elasticsearch.search.aggregations;
import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation;
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
import org.elasticsearch.test.InternalAggregationTestCase;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -94,7 +94,7 @@ public class ParsedAggregationTests extends ESTestCase {
} }
@Override @Override
protected String getType() { public String getType() {
return "type"; return "type";
} }
@ -122,7 +122,7 @@ public class ParsedAggregationTests extends ESTestCase {
} }
@Override @Override
protected String getType() { public String getType() {
return "type"; return "type";
} }

View File

@ -21,7 +21,7 @@ package org.elasticsearch.search.aggregations.metrics.avg;
import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.io.stream.Writeable.Reader;
import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.DocValueFormat;
import org.elasticsearch.search.aggregations.InternalAggregationTestCase; import org.elasticsearch.search.aggregations.ParsedAggregation;
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
import org.elasticsearch.test.InternalAggregationTestCase; import org.elasticsearch.test.InternalAggregationTestCase;

View File

@ -21,8 +21,8 @@ package org.elasticsearch.search.aggregations.metrics.percentiles;
import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.DocValueFormat;
import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.InternalAggregation;
import org.elasticsearch.search.aggregations.InternalAggregationTestCase;
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
import org.elasticsearch.test.InternalAggregationTestCase;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;

View File

@ -21,9 +21,9 @@ package org.elasticsearch.search.aggregations.metrics.percentiles.tdigest;
import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.io.stream.Writeable.Reader;
import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.DocValueFormat;
import org.elasticsearch.search.aggregations.metrics.percentiles.InternalPercentilesRanksTestCase;
import org.elasticsearch.search.aggregations.metrics.percentiles.ParsedPercentiles; import org.elasticsearch.search.aggregations.metrics.percentiles.ParsedPercentiles;
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
import org.elasticsearch.test.InternalAggregationTestCase;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;

View File

@ -20,9 +20,9 @@
package org.elasticsearch.search.aggregations.pipeline.bucketmetrics; package org.elasticsearch.search.aggregations.pipeline.bucketmetrics;
import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.io.stream.Writeable.Reader;
import org.elasticsearch.search.aggregations.InternalAggregationTestCase;
import org.elasticsearch.search.aggregations.ParsedAggregation; import org.elasticsearch.search.aggregations.ParsedAggregation;
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
import org.elasticsearch.test.InternalAggregationTestCase;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;

View File

@ -35,6 +35,9 @@ import org.elasticsearch.rest.action.search.RestSearchAction;
import org.elasticsearch.script.ScriptService; import org.elasticsearch.script.ScriptService;
import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.DocValueFormat;
import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.SearchModule;
import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.InternalAggregation;
import org.elasticsearch.search.aggregations.ParsedAggregation;
import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder;
import org.elasticsearch.search.aggregations.bucket.histogram.HistogramAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.histogram.HistogramAggregationBuilder;
import org.elasticsearch.search.aggregations.bucket.histogram.ParsedDateHistogram; import org.elasticsearch.search.aggregations.bucket.histogram.ParsedDateHistogram;
@ -76,7 +79,16 @@ import org.elasticsearch.search.aggregations.metrics.valuecount.ValueCountAggreg
import org.elasticsearch.search.aggregations.pipeline.InternalSimpleValue; import org.elasticsearch.search.aggregations.pipeline.InternalSimpleValue;
import org.elasticsearch.search.aggregations.pipeline.ParsedSimpleValue; import org.elasticsearch.search.aggregations.pipeline.ParsedSimpleValue;
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.InternalBucketMetricValue;
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.ParsedBucketMetricValue;
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.percentile.ParsedPercentilesBucket;
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.percentile.PercentilesBucketPipelineAggregationBuilder;
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.ParsedStatsBucket;
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.StatsBucketPipelineAggregationBuilder;
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.extended.ExtendedStatsBucketPipelineAggregationBuilder;
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.extended.ParsedExtendedStatsBucket;
import org.elasticsearch.search.aggregations.pipeline.derivative.DerivativePipelineAggregationBuilder;
import org.elasticsearch.search.aggregations.pipeline.derivative.ParsedDerivative;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
@ -99,7 +111,7 @@ public abstract class InternalAggregationTestCase<T extends InternalAggregation>
private final NamedXContentRegistry namedXContentRegistry = new NamedXContentRegistry(getNamedXContents()); private final NamedXContentRegistry namedXContentRegistry = new NamedXContentRegistry(getNamedXContents());
static List<NamedXContentRegistry.Entry> getNamedXContents() { public static List<NamedXContentRegistry.Entry> getNamedXContents() {
Map<String, ContextParser<Object, ? extends Aggregation>> namedXContents = new HashMap<>(); Map<String, ContextParser<Object, ? extends Aggregation>> namedXContents = new HashMap<>();
namedXContents.put(CardinalityAggregationBuilder.NAME, (p, c) -> ParsedCardinality.fromXContent(p, (String) c)); namedXContents.put(CardinalityAggregationBuilder.NAME, (p, c) -> ParsedCardinality.fromXContent(p, (String) c));
namedXContents.put(InternalHDRPercentiles.NAME, (p, c) -> ParsedHDRPercentiles.fromXContent(p, (String) c)); namedXContents.put(InternalHDRPercentiles.NAME, (p, c) -> ParsedHDRPercentiles.fromXContent(p, (String) c));
@ -184,7 +196,7 @@ public abstract class InternalAggregationTestCase<T extends InternalAggregation>
protected abstract void assertReduced(T reduced, List<T> inputs); protected abstract void assertReduced(T reduced, List<T> inputs);
@Override @Override
protected final T createTestInstance() { public final T createTestInstance() {
return createTestInstance(randomAlphaOfLength(5)); return createTestInstance(randomAlphaOfLength(5));
} }