Skip to content

Commit

Permalink
Fix compilation in CumulativeCardinalityAggregatorTests (#46000)
Browse files Browse the repository at this point in the history
Some generics were specified at too fine-grained a level.
  • Loading branch information
dakrone authored Aug 26, 2019
1 parent 54ccdc7 commit 8ff48d8
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ public void testAllNull() throws IOException {
}

public void testParentValidations() throws IOException {
ValuesSourceConfig<ValuesSource.Numeric> numericVS = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC);
ValuesSourceConfig<ValuesSource> valuesSource = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC);

// Histogram
Set<PipelineAggregationBuilder> aggBuilders = new HashSet<>();
aggBuilders.add(new CumulativeCardinalityPipelineAggregationBuilder("cumulative_card", "sum"));
AggregatorFactory parent = new HistogramAggregatorFactory("name", numericVS, 0.0d, 0.0d,
AggregatorFactory parent = new HistogramAggregatorFactory("name", valuesSource, 0.0d, 0.0d,
mock(InternalOrder.class), false, 0L, 0.0d, 1.0d, mock(SearchContext.class), null,
new AggregatorFactories.Builder(), Collections.emptyMap());
CumulativeCardinalityPipelineAggregationBuilder builder
Expand All @@ -131,14 +131,15 @@ public void testParentValidations() throws IOException {
// Date Histogram
aggBuilders.clear();
aggBuilders.add(new CumulativeCardinalityPipelineAggregationBuilder("cumulative_card", "sum"));
parent = new DateHistogramAggregatorFactory("name", numericVS, 0L,
parent = new DateHistogramAggregatorFactory("name", valuesSource, 0L,
mock(InternalOrder.class), false, 0L, mock(Rounding.class), mock(Rounding.class),
mock(ExtendedBounds.class), mock(SearchContext.class), mock(AggregatorFactory.class),
new AggregatorFactories.Builder(), Collections.emptyMap());
builder = new CumulativeCardinalityPipelineAggregationBuilder("name", "valid");
builder.validate(parent, Collections.emptySet(), aggBuilders);

// Auto Date Histogram
ValuesSourceConfig<ValuesSource.Numeric> numericVS = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC);
aggBuilders.clear();
aggBuilders.add(new CumulativeCardinalityPipelineAggregationBuilder("cumulative_card", "sum"));
AutoDateHistogramAggregationBuilder.RoundingInfo[] roundings = new AutoDateHistogramAggregationBuilder.RoundingInfo[1];
Expand Down Expand Up @@ -229,15 +230,16 @@ private static long asLong(String dateTime) {

private static AggregatorFactory getRandomSequentiallyOrderedParentAgg() throws IOException {
AggregatorFactory factory;
ValuesSourceConfig<ValuesSource> valuesSource = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC);
ValuesSourceConfig<ValuesSource.Numeric> numericVS = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC);
switch (randomIntBetween(0, 2)) {
case 0:
factory = new HistogramAggregatorFactory("name", numericVS, 0.0d, 0.0d,
factory = new HistogramAggregatorFactory("name", valuesSource, 0.0d, 0.0d,
mock(InternalOrder.class), false, 0L, 0.0d, 1.0d, mock(SearchContext.class), null,
new AggregatorFactories.Builder(), Collections.emptyMap());
break;
case 1:
factory = new DateHistogramAggregatorFactory("name", numericVS, 0L,
factory = new DateHistogramAggregatorFactory("name", valuesSource, 0L,
mock(InternalOrder.class), false, 0L, mock(Rounding.class), mock(Rounding.class),
mock(ExtendedBounds.class), mock(SearchContext.class), mock(AggregatorFactory.class),
new AggregatorFactories.Builder(), Collections.emptyMap());
Expand Down

0 comments on commit 8ff48d8

Please sign in to comment.