mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-20 11:54:52 +00:00
Fix compilation in CumulativeCardinalityAggregatorTests
This commit is contained in:
parent
54a882ada9
commit
9ac85a4a2b
@ -116,12 +116,12 @@ public class CumulativeCardinalityAggregatorTests extends AggregatorTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testParentValidations() throws IOException {
|
public void testParentValidations() throws IOException {
|
||||||
ValuesSourceConfig<ValuesSource.Numeric> numericVS = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC);
|
ValuesSourceConfig<ValuesSource> valuesSourceConfig = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC);
|
||||||
|
|
||||||
// Histogram
|
// Histogram
|
||||||
Set<PipelineAggregationBuilder> aggBuilders = new HashSet<>();
|
Set<PipelineAggregationBuilder> aggBuilders = new HashSet<>();
|
||||||
aggBuilders.add(new CumulativeCardinalityPipelineAggregationBuilder("cumulative_card", "sum"));
|
aggBuilders.add(new CumulativeCardinalityPipelineAggregationBuilder("cumulative_card", "sum"));
|
||||||
AggregatorFactory parent = new HistogramAggregatorFactory("name", numericVS, 0.0d, 0.0d,
|
AggregatorFactory parent = new HistogramAggregatorFactory("name", valuesSourceConfig, 0.0d, 0.0d,
|
||||||
mock(InternalOrder.class), false, 0L, 0.0d, 1.0d, mock(SearchContext.class), null,
|
mock(InternalOrder.class), false, 0L, 0.0d, 1.0d, mock(SearchContext.class), null,
|
||||||
new AggregatorFactories.Builder(), Collections.emptyMap());
|
new AggregatorFactories.Builder(), Collections.emptyMap());
|
||||||
CumulativeCardinalityPipelineAggregationBuilder builder
|
CumulativeCardinalityPipelineAggregationBuilder builder
|
||||||
@ -131,7 +131,7 @@ public class CumulativeCardinalityAggregatorTests extends AggregatorTestCase {
|
|||||||
// Date Histogram
|
// Date Histogram
|
||||||
aggBuilders.clear();
|
aggBuilders.clear();
|
||||||
aggBuilders.add(new CumulativeCardinalityPipelineAggregationBuilder("cumulative_card", "sum"));
|
aggBuilders.add(new CumulativeCardinalityPipelineAggregationBuilder("cumulative_card", "sum"));
|
||||||
parent = new DateHistogramAggregatorFactory("name", numericVS, 0L,
|
parent = new DateHistogramAggregatorFactory("name", valuesSourceConfig, 0L,
|
||||||
mock(InternalOrder.class), false, 0L, mock(Rounding.class), mock(Rounding.class),
|
mock(InternalOrder.class), false, 0L, mock(Rounding.class), mock(Rounding.class),
|
||||||
mock(ExtendedBounds.class), mock(SearchContext.class), mock(AggregatorFactory.class),
|
mock(ExtendedBounds.class), mock(SearchContext.class), mock(AggregatorFactory.class),
|
||||||
new AggregatorFactories.Builder(), Collections.emptyMap());
|
new AggregatorFactories.Builder(), Collections.emptyMap());
|
||||||
@ -139,6 +139,7 @@ public class CumulativeCardinalityAggregatorTests extends AggregatorTestCase {
|
|||||||
builder.validate(parent, Collections.emptySet(), aggBuilders);
|
builder.validate(parent, Collections.emptySet(), aggBuilders);
|
||||||
|
|
||||||
// Auto Date Histogram
|
// Auto Date Histogram
|
||||||
|
ValuesSourceConfig<ValuesSource.Numeric> numericVS = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC);
|
||||||
aggBuilders.clear();
|
aggBuilders.clear();
|
||||||
aggBuilders.add(new CumulativeCardinalityPipelineAggregationBuilder("cumulative_card", "sum"));
|
aggBuilders.add(new CumulativeCardinalityPipelineAggregationBuilder("cumulative_card", "sum"));
|
||||||
AutoDateHistogramAggregationBuilder.RoundingInfo[] roundings = new AutoDateHistogramAggregationBuilder.RoundingInfo[1];
|
AutoDateHistogramAggregationBuilder.RoundingInfo[] roundings = new AutoDateHistogramAggregationBuilder.RoundingInfo[1];
|
||||||
@ -229,21 +230,22 @@ public class CumulativeCardinalityAggregatorTests extends AggregatorTestCase {
|
|||||||
|
|
||||||
private static AggregatorFactory getRandomSequentiallyOrderedParentAgg() throws IOException {
|
private static AggregatorFactory getRandomSequentiallyOrderedParentAgg() throws IOException {
|
||||||
AggregatorFactory factory;
|
AggregatorFactory factory;
|
||||||
ValuesSourceConfig<ValuesSource.Numeric> numericVS = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC);
|
ValuesSourceConfig<ValuesSource> valuesSourceConfig = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC);
|
||||||
switch (randomIntBetween(0, 2)) {
|
switch (randomIntBetween(0, 2)) {
|
||||||
case 0:
|
case 0:
|
||||||
factory = new HistogramAggregatorFactory("name", numericVS, 0.0d, 0.0d,
|
factory = new HistogramAggregatorFactory("name", valuesSourceConfig, 0.0d, 0.0d,
|
||||||
mock(InternalOrder.class), false, 0L, 0.0d, 1.0d, mock(SearchContext.class), null,
|
mock(InternalOrder.class), false, 0L, 0.0d, 1.0d, mock(SearchContext.class), null,
|
||||||
new AggregatorFactories.Builder(), Collections.emptyMap());
|
new AggregatorFactories.Builder(), Collections.emptyMap());
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
factory = new DateHistogramAggregatorFactory("name", numericVS, 0L,
|
factory = new DateHistogramAggregatorFactory("name", valuesSourceConfig, 0L,
|
||||||
mock(InternalOrder.class), false, 0L, mock(Rounding.class), mock(Rounding.class),
|
mock(InternalOrder.class), false, 0L, mock(Rounding.class), mock(Rounding.class),
|
||||||
mock(ExtendedBounds.class), mock(SearchContext.class), mock(AggregatorFactory.class),
|
mock(ExtendedBounds.class), mock(SearchContext.class), mock(AggregatorFactory.class),
|
||||||
new AggregatorFactories.Builder(), Collections.emptyMap());
|
new AggregatorFactories.Builder(), Collections.emptyMap());
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
default:
|
default:
|
||||||
|
ValuesSourceConfig<ValuesSource.Numeric> numericVS = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC);
|
||||||
AutoDateHistogramAggregationBuilder.RoundingInfo[] roundings = new AutoDateHistogramAggregationBuilder.RoundingInfo[1];
|
AutoDateHistogramAggregationBuilder.RoundingInfo[] roundings = new AutoDateHistogramAggregationBuilder.RoundingInfo[1];
|
||||||
factory = new AutoDateHistogramAggregatorFactory("name", numericVS,
|
factory = new AutoDateHistogramAggregatorFactory("name", numericVS,
|
||||||
1, roundings,
|
1, roundings,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user