AggregatorFactory was generic over itself, but it doesn't appear we use this functionality anywhere (e.g. to allow the super class to declare arguments/return types generically for subclasses to override). Most places use a wildcard constraint, and even when a concrete type is specified it wasn't used. But since AggFactories are widely used, this led to the generic touching many pieces of code and making type signatures fairly complex
This commit is contained in:
parent
b158919542
commit
92ad588275
|
@ -81,7 +81,7 @@ public class MatrixStatsAggregationBuilder
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected MatrixStatsAggregatorFactory innerBuild(SearchContext context, Map<String, ValuesSourceConfig<Numeric>> configs,
|
protected MatrixStatsAggregatorFactory innerBuild(SearchContext context, Map<String, ValuesSourceConfig<Numeric>> configs,
|
||||||
AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder) throws IOException {
|
||||||
return new MatrixStatsAggregatorFactory(name, configs, multiValueMode, context, parent, subFactoriesBuilder, metaData);
|
return new MatrixStatsAggregatorFactory(name, configs, multiValueMode, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,14 +32,13 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
final class MatrixStatsAggregatorFactory
|
final class MatrixStatsAggregatorFactory extends ArrayValuesSourceAggregatorFactory<ValuesSource.Numeric> {
|
||||||
extends ArrayValuesSourceAggregatorFactory<ValuesSource.Numeric, MatrixStatsAggregatorFactory> {
|
|
||||||
|
|
||||||
private final MultiValueMode multiValueMode;
|
private final MultiValueMode multiValueMode;
|
||||||
|
|
||||||
MatrixStatsAggregatorFactory(String name,
|
MatrixStatsAggregatorFactory(String name,
|
||||||
Map<String, ValuesSourceConfig<ValuesSource.Numeric>> configs, MultiValueMode multiValueMode,
|
Map<String, ValuesSourceConfig<ValuesSource.Numeric>> configs, MultiValueMode multiValueMode,
|
||||||
SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder,
|
SearchContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder,
|
||||||
Map<String, Object> metaData) throws IOException {
|
Map<String, Object> metaData) throws IOException {
|
||||||
super(name, configs, context, parent, subFactoriesBuilder, metaData);
|
super(name, configs, context, parent, subFactoriesBuilder, metaData);
|
||||||
this.multiValueMode = multiValueMode;
|
this.multiValueMode = multiValueMode;
|
||||||
|
|
|
@ -239,10 +239,10 @@ public abstract class ArrayValuesSourceAggregationBuilder<VS extends ValuesSourc
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected final ArrayValuesSourceAggregatorFactory<VS, ?> doBuild(SearchContext context, AggregatorFactory<?> parent,
|
protected final ArrayValuesSourceAggregatorFactory<VS> doBuild(SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactories.Builder subFactoriesBuilder) throws IOException {
|
||||||
Map<String, ValuesSourceConfig<VS>> configs = resolveConfig(context);
|
Map<String, ValuesSourceConfig<VS>> configs = resolveConfig(context);
|
||||||
ArrayValuesSourceAggregatorFactory<VS, ?> factory = innerBuild(context, configs, parent, subFactoriesBuilder);
|
ArrayValuesSourceAggregatorFactory<VS> factory = innerBuild(context, configs, parent, subFactoriesBuilder);
|
||||||
return factory;
|
return factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -255,9 +255,9 @@ public abstract class ArrayValuesSourceAggregationBuilder<VS extends ValuesSourc
|
||||||
return configs;
|
return configs;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract ArrayValuesSourceAggregatorFactory<VS, ?> innerBuild(SearchContext context,
|
protected abstract ArrayValuesSourceAggregatorFactory<VS> innerBuild(SearchContext context,
|
||||||
Map<String, ValuesSourceConfig<VS>> configs,
|
Map<String, ValuesSourceConfig<VS>> configs,
|
||||||
AggregatorFactory<?> parent,
|
AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder) throws IOException;
|
AggregatorFactories.Builder subFactoriesBuilder) throws IOException;
|
||||||
|
|
||||||
public ValuesSourceConfig<VS> config(SearchContext context, String field, Script script) {
|
public ValuesSourceConfig<VS> config(SearchContext context, String field, Script script) {
|
||||||
|
|
|
@ -30,13 +30,13 @@ import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public abstract class ArrayValuesSourceAggregatorFactory<VS extends ValuesSource, AF extends ArrayValuesSourceAggregatorFactory<VS, AF>>
|
public abstract class ArrayValuesSourceAggregatorFactory<VS extends ValuesSource>
|
||||||
extends AggregatorFactory<AF> {
|
extends AggregatorFactory {
|
||||||
|
|
||||||
protected Map<String, ValuesSourceConfig<VS>> configs;
|
protected Map<String, ValuesSourceConfig<VS>> configs;
|
||||||
|
|
||||||
public ArrayValuesSourceAggregatorFactory(String name, Map<String, ValuesSourceConfig<VS>> configs,
|
public ArrayValuesSourceAggregatorFactory(String name, Map<String, ValuesSourceConfig<VS>> configs,
|
||||||
SearchContext context, AggregatorFactory<?> parent,
|
SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder,
|
AggregatorFactories.Builder subFactoriesBuilder,
|
||||||
Map<String, Object> metaData) throws IOException {
|
Map<String, Object> metaData) throws IOException {
|
||||||
super(name, context, parent, subFactoriesBuilder, metaData);
|
super(name, context, parent, subFactoriesBuilder, metaData);
|
||||||
|
|
|
@ -95,9 +95,9 @@ public class ChildrenAggregationBuilder
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ValuesSourceAggregatorFactory<WithOrdinals, ?> innerBuild(SearchContext context,
|
protected ValuesSourceAggregatorFactory<WithOrdinals> innerBuild(SearchContext context,
|
||||||
ValuesSourceConfig<WithOrdinals> config,
|
ValuesSourceConfig<WithOrdinals> config,
|
||||||
AggregatorFactory<?> parent,
|
AggregatorFactory parent,
|
||||||
Builder subFactoriesBuilder) throws IOException {
|
Builder subFactoriesBuilder) throws IOException {
|
||||||
return new ChildrenAggregatorFactory(name, config, childFilter, parentFilter, context, parent,
|
return new ChildrenAggregatorFactory(name, config, childFilter, parentFilter, context, parent,
|
||||||
subFactoriesBuilder, metaData);
|
subFactoriesBuilder, metaData);
|
||||||
|
|
|
@ -35,7 +35,7 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class ChildrenAggregatorFactory extends ValuesSourceAggregatorFactory<WithOrdinals, ChildrenAggregatorFactory> {
|
public class ChildrenAggregatorFactory extends ValuesSourceAggregatorFactory<WithOrdinals> {
|
||||||
|
|
||||||
private final Query parentFilter;
|
private final Query parentFilter;
|
||||||
private final Query childFilter;
|
private final Query childFilter;
|
||||||
|
@ -45,7 +45,7 @@ public class ChildrenAggregatorFactory extends ValuesSourceAggregatorFactory<Wit
|
||||||
Query childFilter,
|
Query childFilter,
|
||||||
Query parentFilter,
|
Query parentFilter,
|
||||||
SearchContext context,
|
SearchContext context,
|
||||||
AggregatorFactory<?> parent,
|
AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder,
|
AggregatorFactories.Builder subFactoriesBuilder,
|
||||||
Map<String, Object> metaData) throws IOException {
|
Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
|
|
|
@ -95,9 +95,9 @@ public class ParentAggregationBuilder
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ValuesSourceAggregatorFactory<WithOrdinals, ?> innerBuild(SearchContext context,
|
protected ValuesSourceAggregatorFactory<WithOrdinals> innerBuild(SearchContext context,
|
||||||
ValuesSourceConfig<WithOrdinals> config,
|
ValuesSourceConfig<WithOrdinals> config,
|
||||||
AggregatorFactory<?> parent,
|
AggregatorFactory parent,
|
||||||
Builder subFactoriesBuilder) throws IOException {
|
Builder subFactoriesBuilder) throws IOException {
|
||||||
return new ParentAggregatorFactory(name, config, childFilter, parentFilter, context, parent,
|
return new ParentAggregatorFactory(name, config, childFilter, parentFilter, context, parent,
|
||||||
subFactoriesBuilder, metaData);
|
subFactoriesBuilder, metaData);
|
||||||
|
|
|
@ -35,7 +35,7 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class ParentAggregatorFactory extends ValuesSourceAggregatorFactory<WithOrdinals, ParentAggregatorFactory> {
|
public class ParentAggregatorFactory extends ValuesSourceAggregatorFactory<WithOrdinals> {
|
||||||
|
|
||||||
private final Query parentFilter;
|
private final Query parentFilter;
|
||||||
private final Query childFilter;
|
private final Query childFilter;
|
||||||
|
@ -45,7 +45,7 @@ public class ParentAggregatorFactory extends ValuesSourceAggregatorFactory<WithO
|
||||||
Query childFilter,
|
Query childFilter,
|
||||||
Query parentFilter,
|
Query parentFilter,
|
||||||
SearchContext context,
|
SearchContext context,
|
||||||
AggregatorFactory<?> parent,
|
AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder,
|
AggregatorFactories.Builder subFactoriesBuilder,
|
||||||
Map<String, Object> metaData) throws IOException {
|
Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
|
|
|
@ -135,12 +135,12 @@ public abstract class AbstractAggregationBuilder<AB extends AbstractAggregationB
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final AggregatorFactory<?> build(SearchContext context, AggregatorFactory<?> parent) throws IOException {
|
public final AggregatorFactory build(SearchContext context, AggregatorFactory parent) throws IOException {
|
||||||
AggregatorFactory<?> factory = doBuild(context, parent, factoriesBuilder);
|
AggregatorFactory factory = doBuild(context, parent, factoriesBuilder);
|
||||||
return factory;
|
return factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract AggregatorFactory<?> doBuild(SearchContext context, AggregatorFactory<?> parent,
|
protected abstract AggregatorFactory doBuild(SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subfactoriesBuilder) throws IOException;
|
AggregatorFactories.Builder subfactoriesBuilder) throws IOException;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -63,7 +63,7 @@ public abstract class AggregationBuilder
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Internal: build an {@link AggregatorFactory} based on the configuration of this builder. */
|
/** Internal: build an {@link AggregatorFactory} based on the configuration of this builder. */
|
||||||
protected abstract AggregatorFactory<?> build(SearchContext context, AggregatorFactory<?> parent) throws IOException;
|
protected abstract AggregatorFactory build(SearchContext context, AggregatorFactory parent) throws IOException;
|
||||||
|
|
||||||
/** Associate metadata with this {@link AggregationBuilder}. */
|
/** Associate metadata with this {@link AggregationBuilder}. */
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -161,16 +161,16 @@ public class AggregatorFactories {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final AggregatorFactories EMPTY = new AggregatorFactories(new AggregatorFactory<?>[0], new ArrayList<>());
|
public static final AggregatorFactories EMPTY = new AggregatorFactories(new AggregatorFactory[0], new ArrayList<>());
|
||||||
|
|
||||||
private AggregatorFactory<?>[] factories;
|
private AggregatorFactory[] factories;
|
||||||
private List<PipelineAggregationBuilder> pipelineAggregatorFactories;
|
private List<PipelineAggregationBuilder> pipelineAggregatorFactories;
|
||||||
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
private AggregatorFactories(AggregatorFactory<?>[] factories, List<PipelineAggregationBuilder> pipelineAggregators) {
|
private AggregatorFactories(AggregatorFactory[] factories, List<PipelineAggregationBuilder> pipelineAggregators) {
|
||||||
this.factories = factories;
|
this.factories = factories;
|
||||||
this.pipelineAggregatorFactories = pipelineAggregators;
|
this.pipelineAggregatorFactories = pipelineAggregators;
|
||||||
}
|
}
|
||||||
|
@ -314,7 +314,7 @@ public class AggregatorFactories {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AggregatorFactories build(SearchContext context, AggregatorFactory<?> parent) throws IOException {
|
public AggregatorFactories build(SearchContext context, AggregatorFactory parent) throws IOException {
|
||||||
if (aggregationBuilders.isEmpty() && pipelineAggregatorBuilders.isEmpty()) {
|
if (aggregationBuilders.isEmpty() && pipelineAggregatorBuilders.isEmpty()) {
|
||||||
return EMPTY;
|
return EMPTY;
|
||||||
}
|
}
|
||||||
|
@ -325,7 +325,7 @@ public class AggregatorFactories {
|
||||||
orderedpipelineAggregators = resolvePipelineAggregatorOrder(this.pipelineAggregatorBuilders, this.aggregationBuilders,
|
orderedpipelineAggregators = resolvePipelineAggregatorOrder(this.pipelineAggregatorBuilders, this.aggregationBuilders,
|
||||||
parent);
|
parent);
|
||||||
}
|
}
|
||||||
AggregatorFactory<?>[] aggFactories = new AggregatorFactory<?>[aggregationBuilders.size()];
|
AggregatorFactory[] aggFactories = new AggregatorFactory[aggregationBuilders.size()];
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (AggregationBuilder agg : aggregationBuilders) {
|
for (AggregationBuilder agg : aggregationBuilders) {
|
||||||
|
@ -337,7 +337,7 @@ public class AggregatorFactories {
|
||||||
|
|
||||||
private List<PipelineAggregationBuilder> resolvePipelineAggregatorOrder(
|
private List<PipelineAggregationBuilder> resolvePipelineAggregatorOrder(
|
||||||
Collection<PipelineAggregationBuilder> pipelineAggregatorBuilders, Collection<AggregationBuilder> aggregationBuilders,
|
Collection<PipelineAggregationBuilder> pipelineAggregatorBuilders, Collection<AggregationBuilder> aggregationBuilders,
|
||||||
AggregatorFactory<?> parent) {
|
AggregatorFactory parent) {
|
||||||
Map<String, PipelineAggregationBuilder> pipelineAggregatorBuildersMap = new HashMap<>();
|
Map<String, PipelineAggregationBuilder> pipelineAggregatorBuildersMap = new HashMap<>();
|
||||||
for (PipelineAggregationBuilder builder : pipelineAggregatorBuilders) {
|
for (PipelineAggregationBuilder builder : pipelineAggregatorBuilders) {
|
||||||
pipelineAggregatorBuildersMap.put(builder.getName(), builder);
|
pipelineAggregatorBuildersMap.put(builder.getName(), builder);
|
||||||
|
|
|
@ -33,17 +33,17 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public abstract class AggregatorFactory<AF extends AggregatorFactory<AF>> {
|
public abstract class AggregatorFactory {
|
||||||
|
|
||||||
public static final class MultiBucketAggregatorWrapper extends Aggregator {
|
public static final class MultiBucketAggregatorWrapper extends Aggregator {
|
||||||
private final BigArrays bigArrays;
|
private final BigArrays bigArrays;
|
||||||
private final Aggregator parent;
|
private final Aggregator parent;
|
||||||
private final AggregatorFactory<?> factory;
|
private final AggregatorFactory factory;
|
||||||
private final Aggregator first;
|
private final Aggregator first;
|
||||||
ObjectArray<Aggregator> aggregators;
|
ObjectArray<Aggregator> aggregators;
|
||||||
ObjectArray<LeafBucketCollector> collectors;
|
ObjectArray<LeafBucketCollector> collectors;
|
||||||
|
|
||||||
MultiBucketAggregatorWrapper(BigArrays bigArrays, SearchContext context, Aggregator parent, AggregatorFactory<?> factory,
|
MultiBucketAggregatorWrapper(BigArrays bigArrays, SearchContext context, Aggregator parent, AggregatorFactory factory,
|
||||||
Aggregator first) {
|
Aggregator first) {
|
||||||
this.bigArrays = bigArrays;
|
this.bigArrays = bigArrays;
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
|
@ -167,7 +167,7 @@ public abstract class AggregatorFactory<AF extends AggregatorFactory<AF>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final String name;
|
protected final String name;
|
||||||
protected final AggregatorFactory<?> parent;
|
protected final AggregatorFactory parent;
|
||||||
protected final AggregatorFactories factories;
|
protected final AggregatorFactories factories;
|
||||||
protected final Map<String, Object> metaData;
|
protected final Map<String, Object> metaData;
|
||||||
protected final SearchContext context;
|
protected final SearchContext context;
|
||||||
|
@ -180,7 +180,7 @@ public abstract class AggregatorFactory<AF extends AggregatorFactory<AF>> {
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
* if an error occurs creating the factory
|
* if an error occurs creating the factory
|
||||||
*/
|
*/
|
||||||
public AggregatorFactory(String name, SearchContext context, AggregatorFactory<?> parent,
|
public AggregatorFactory(String name, SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.context = context;
|
this.context = context;
|
||||||
|
@ -217,7 +217,7 @@ public abstract class AggregatorFactory<AF extends AggregatorFactory<AF>> {
|
||||||
return createInternal(parent, collectsFromSingleBucket, this.factories.createPipelineAggregators(), this.metaData);
|
return createInternal(parent, collectsFromSingleBucket, this.factories.createPipelineAggregators(), this.metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AggregatorFactory<?> getParent() {
|
public AggregatorFactory getParent() {
|
||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ public abstract class AggregatorFactory<AF extends AggregatorFactory<AF>> {
|
||||||
* {@link Aggregator}s that only know how to collect bucket {@code 0}, this
|
* {@link Aggregator}s that only know how to collect bucket {@code 0}, this
|
||||||
* returns an aggregator that can collect any bucket.
|
* returns an aggregator that can collect any bucket.
|
||||||
*/
|
*/
|
||||||
protected static Aggregator asMultiBucketAggregator(final AggregatorFactory<?> factory, final SearchContext context,
|
protected static Aggregator asMultiBucketAggregator(final AggregatorFactory factory, final SearchContext context,
|
||||||
final Aggregator parent) throws IOException {
|
final Aggregator parent) throws IOException {
|
||||||
final Aggregator first = factory.create(parent, true);
|
final Aggregator first = factory.create(parent, true);
|
||||||
final BigArrays bigArrays = context.bigArrays();
|
final BigArrays bigArrays = context.bigArrays();
|
||||||
|
|
|
@ -67,7 +67,7 @@ public abstract class PipelineAggregationBuilder implements NamedWriteable, Base
|
||||||
* Internal: Validates the state of this factory (makes sure the factory is properly
|
* Internal: Validates the state of this factory (makes sure the factory is properly
|
||||||
* configured)
|
* configured)
|
||||||
*/
|
*/
|
||||||
protected abstract void validate(AggregatorFactory<?> parent, Collection<AggregationBuilder> aggregationBuilders,
|
protected abstract void validate(AggregatorFactory parent, Collection<AggregationBuilder> aggregationBuilders,
|
||||||
Collection<PipelineAggregationBuilder> pipelineAggregatorBuilders);
|
Collection<PipelineAggregationBuilder> pipelineAggregatorBuilders);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -196,7 +196,7 @@ public class AdjacencyMatrixAggregationBuilder extends AbstractAggregationBuilde
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected AggregatorFactory<?> doBuild(SearchContext context, AggregatorFactory<?> parent, Builder subFactoriesBuilder)
|
protected AggregatorFactory doBuild(SearchContext context, AggregatorFactory parent, Builder subFactoriesBuilder)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
int maxFilters = context.indexShard().indexSettings().getMaxAdjacencyMatrixFilters();
|
int maxFilters = context.indexShard().indexSettings().getMaxAdjacencyMatrixFilters();
|
||||||
if (filters.size() > maxFilters){
|
if (filters.size() > maxFilters){
|
||||||
|
|
|
@ -34,14 +34,14 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class AdjacencyMatrixAggregatorFactory extends AggregatorFactory<AdjacencyMatrixAggregatorFactory> {
|
public class AdjacencyMatrixAggregatorFactory extends AggregatorFactory {
|
||||||
|
|
||||||
private final String[] keys;
|
private final String[] keys;
|
||||||
private final Weight[] weights;
|
private final Weight[] weights;
|
||||||
private final String separator;
|
private final String separator;
|
||||||
|
|
||||||
public AdjacencyMatrixAggregatorFactory(String name, List<KeyedFilter> filters, String separator,
|
public AdjacencyMatrixAggregatorFactory(String name, List<KeyedFilter> filters, String separator,
|
||||||
SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactories,
|
SearchContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactories,
|
||||||
Map<String, Object> metaData) throws IOException {
|
Map<String, Object> metaData) throws IOException {
|
||||||
super(name, context, parent, subFactories, metaData);
|
super(name, context, parent, subFactories, metaData);
|
||||||
IndexSearcher contextSearcher = context.searcher();
|
IndexSearcher contextSearcher = context.searcher();
|
||||||
|
|
|
@ -162,7 +162,7 @@ public class CompositeAggregationBuilder extends AbstractAggregationBuilder<Comp
|
||||||
* this aggregator or the instance of the parent's factory that is incompatible with
|
* this aggregator or the instance of the parent's factory that is incompatible with
|
||||||
* the composite aggregation.
|
* the composite aggregation.
|
||||||
*/
|
*/
|
||||||
private AggregatorFactory<?> checkParentIsNullOrNested(AggregatorFactory<?> factory) {
|
private AggregatorFactory checkParentIsNullOrNested(AggregatorFactory factory) {
|
||||||
if (factory == null) {
|
if (factory == null) {
|
||||||
return null;
|
return null;
|
||||||
} else if (factory instanceof NestedAggregatorFactory) {
|
} else if (factory instanceof NestedAggregatorFactory) {
|
||||||
|
@ -195,9 +195,9 @@ public class CompositeAggregationBuilder extends AbstractAggregationBuilder<Comp
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected AggregatorFactory<?> doBuild(SearchContext context, AggregatorFactory<?> parent,
|
protected AggregatorFactory doBuild(SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subfactoriesBuilder) throws IOException {
|
AggregatorFactories.Builder subfactoriesBuilder) throws IOException {
|
||||||
AggregatorFactory<?> invalid = checkParentIsNullOrNested(parent);
|
AggregatorFactory invalid = checkParentIsNullOrNested(parent);
|
||||||
if (invalid != null) {
|
if (invalid != null) {
|
||||||
throw new IllegalArgumentException("[composite] aggregation cannot be used with a parent aggregation of" +
|
throw new IllegalArgumentException("[composite] aggregation cannot be used with a parent aggregation of" +
|
||||||
" type: [" + invalid.getClass().getSimpleName() + "]");
|
" type: [" + invalid.getClass().getSimpleName() + "]");
|
||||||
|
|
|
@ -29,12 +29,12 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
class CompositeAggregationFactory extends AggregatorFactory<CompositeAggregationFactory> {
|
class CompositeAggregationFactory extends AggregatorFactory {
|
||||||
private final int size;
|
private final int size;
|
||||||
private final CompositeValuesSourceConfig[] sources;
|
private final CompositeValuesSourceConfig[] sources;
|
||||||
private final CompositeKey afterKey;
|
private final CompositeKey afterKey;
|
||||||
|
|
||||||
CompositeAggregationFactory(String name, SearchContext context, AggregatorFactory<?> parent,
|
CompositeAggregationFactory(String name, SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData,
|
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData,
|
||||||
int size, CompositeValuesSourceConfig[] sources, CompositeKey afterKey) throws IOException {
|
int size, CompositeValuesSourceConfig[] sources, CompositeKey afterKey) throws IOException {
|
||||||
super(name, context, parent, subFactoriesBuilder, metaData);
|
super(name, context, parent, subFactoriesBuilder, metaData);
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class FilterAggregationBuilder extends AbstractAggregationBuilder<FilterA
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected AggregatorFactory<?> doBuild(SearchContext context, AggregatorFactory<?> parent,
|
protected AggregatorFactory doBuild(SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactories.Builder subFactoriesBuilder) throws IOException {
|
||||||
return new FilterAggregatorFactory(name, filter, context, parent, subFactoriesBuilder, metaData);
|
return new FilterAggregatorFactory(name, filter, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,13 +35,13 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class FilterAggregatorFactory extends AggregatorFactory<FilterAggregatorFactory> {
|
public class FilterAggregatorFactory extends AggregatorFactory {
|
||||||
|
|
||||||
private Weight weight;
|
private Weight weight;
|
||||||
private Query filter;
|
private Query filter;
|
||||||
|
|
||||||
public FilterAggregatorFactory(String name, QueryBuilder filterBuilder, SearchContext context,
|
public FilterAggregatorFactory(String name, QueryBuilder filterBuilder, SearchContext context,
|
||||||
AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, context, parent, subFactoriesBuilder, metaData);
|
super(name, context, parent, subFactoriesBuilder, metaData);
|
||||||
filter = filterBuilder.toQuery(context.getQueryShardContext());
|
filter = filterBuilder.toQuery(context.getQueryShardContext());
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,7 +220,7 @@ public class FiltersAggregationBuilder extends AbstractAggregationBuilder<Filter
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected AggregatorFactory<?> doBuild(SearchContext context, AggregatorFactory<?> parent, Builder subFactoriesBuilder)
|
protected AggregatorFactory doBuild(SearchContext context, AggregatorFactory parent, Builder subFactoriesBuilder)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
return new FiltersAggregatorFactory(name, filters, keyed, otherBucket, otherBucketKey, context, parent,
|
return new FiltersAggregatorFactory(name, filters, keyed, otherBucket, otherBucketKey, context, parent,
|
||||||
subFactoriesBuilder, metaData);
|
subFactoriesBuilder, metaData);
|
||||||
|
|
|
@ -35,7 +35,7 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class FiltersAggregatorFactory extends AggregatorFactory<FiltersAggregatorFactory> {
|
public class FiltersAggregatorFactory extends AggregatorFactory {
|
||||||
|
|
||||||
private final String[] keys;
|
private final String[] keys;
|
||||||
private final Query[] filters;
|
private final Query[] filters;
|
||||||
|
@ -45,7 +45,7 @@ public class FiltersAggregatorFactory extends AggregatorFactory<FiltersAggregato
|
||||||
private final String otherBucketKey;
|
private final String otherBucketKey;
|
||||||
|
|
||||||
public FiltersAggregatorFactory(String name, List<KeyedFilter> filters, boolean keyed, boolean otherBucket,
|
public FiltersAggregatorFactory(String name, List<KeyedFilter> filters, boolean keyed, boolean otherBucket,
|
||||||
String otherBucketKey, SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactories,
|
String otherBucketKey, SearchContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactories,
|
||||||
Map<String, Object> metaData) throws IOException {
|
Map<String, Object> metaData) throws IOException {
|
||||||
super(name, context, parent, subFactories, metaData);
|
super(name, context, parent, subFactories, metaData);
|
||||||
this.keyed = keyed;
|
this.keyed = keyed;
|
||||||
|
|
|
@ -108,9 +108,9 @@ public abstract class GeoGridAggregationBuilder extends ValuesSourceAggregationB
|
||||||
/**
|
/**
|
||||||
* Creates a new instance of the {@link ValuesSourceAggregatorFactory}-derived class specific to the geo aggregation.
|
* Creates a new instance of the {@link ValuesSourceAggregatorFactory}-derived class specific to the geo aggregation.
|
||||||
*/
|
*/
|
||||||
protected abstract ValuesSourceAggregatorFactory<ValuesSource.GeoPoint,?> createFactory(
|
protected abstract ValuesSourceAggregatorFactory<ValuesSource.GeoPoint> createFactory(
|
||||||
String name, ValuesSourceConfig<ValuesSource.GeoPoint> config, int precision, int requiredSize, int shardSize,
|
String name, ValuesSourceConfig<ValuesSource.GeoPoint> config, int precision, int requiredSize, int shardSize,
|
||||||
SearchContext context, AggregatorFactory<?> parent, Builder subFactoriesBuilder, Map<String, Object> metaData
|
SearchContext context, AggregatorFactory parent, Builder subFactoriesBuilder, Map<String, Object> metaData
|
||||||
) throws IOException;
|
) throws IOException;
|
||||||
|
|
||||||
public int precision() {
|
public int precision() {
|
||||||
|
@ -144,8 +144,8 @@ public abstract class GeoGridAggregationBuilder extends ValuesSourceAggregationB
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ValuesSourceAggregatorFactory<ValuesSource.GeoPoint, ?> innerBuild(SearchContext context,
|
protected ValuesSourceAggregatorFactory<ValuesSource.GeoPoint> innerBuild(SearchContext context,
|
||||||
ValuesSourceConfig<ValuesSource.GeoPoint> config, AggregatorFactory<?> parent, Builder subFactoriesBuilder)
|
ValuesSourceConfig<ValuesSource.GeoPoint> config, AggregatorFactory parent, Builder subFactoriesBuilder)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
int shardSize = this.shardSize;
|
int shardSize = this.shardSize;
|
||||||
|
|
||||||
|
|
|
@ -59,9 +59,9 @@ public class GeoHashGridAggregationBuilder extends GeoGridAggregationBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ValuesSourceAggregatorFactory<ValuesSource.GeoPoint, ?> createFactory(
|
protected ValuesSourceAggregatorFactory<ValuesSource.GeoPoint> createFactory(
|
||||||
String name, ValuesSourceConfig<ValuesSource.GeoPoint> config, int precision, int requiredSize, int shardSize,
|
String name, ValuesSourceConfig<ValuesSource.GeoPoint> config, int precision, int requiredSize, int shardSize,
|
||||||
SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder,
|
SearchContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder,
|
||||||
Map<String, Object> metaData
|
Map<String, Object> metaData
|
||||||
) throws IOException {
|
) throws IOException {
|
||||||
return new GeoHashGridAggregatorFactory(name, config, precision, requiredSize, shardSize, context, parent,
|
return new GeoHashGridAggregatorFactory(name, config, precision, requiredSize, shardSize, context, parent,
|
||||||
|
|
|
@ -37,14 +37,14 @@ import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class GeoHashGridAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.GeoPoint, GeoHashGridAggregatorFactory> {
|
public class GeoHashGridAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.GeoPoint> {
|
||||||
|
|
||||||
private final int precision;
|
private final int precision;
|
||||||
private final int requiredSize;
|
private final int requiredSize;
|
||||||
private final int shardSize;
|
private final int shardSize;
|
||||||
|
|
||||||
GeoHashGridAggregatorFactory(String name, ValuesSourceConfig<GeoPoint> config, int precision, int requiredSize,
|
GeoHashGridAggregatorFactory(String name, ValuesSourceConfig<GeoPoint> config, int precision, int requiredSize,
|
||||||
int shardSize, SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder,
|
int shardSize, SearchContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder,
|
||||||
Map<String, Object> metaData) throws IOException {
|
Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
this.precision = precision;
|
this.precision = precision;
|
||||||
|
|
|
@ -58,9 +58,9 @@ public class GeoTileGridAggregationBuilder extends GeoGridAggregationBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ValuesSourceAggregatorFactory<ValuesSource.GeoPoint, ?> createFactory(
|
protected ValuesSourceAggregatorFactory<ValuesSource.GeoPoint> createFactory(
|
||||||
String name, ValuesSourceConfig<ValuesSource.GeoPoint> config, int precision, int requiredSize, int shardSize,
|
String name, ValuesSourceConfig<ValuesSource.GeoPoint> config, int precision, int requiredSize, int shardSize,
|
||||||
SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder,
|
SearchContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder,
|
||||||
Map<String, Object> metaData
|
Map<String, Object> metaData
|
||||||
) throws IOException {
|
) throws IOException {
|
||||||
return new GeoTileGridAggregatorFactory(name, config, precision, requiredSize, shardSize, context, parent,
|
return new GeoTileGridAggregatorFactory(name, config, precision, requiredSize, shardSize, context, parent,
|
||||||
|
|
|
@ -36,14 +36,14 @@ import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class GeoTileGridAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.GeoPoint, GeoTileGridAggregatorFactory> {
|
public class GeoTileGridAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.GeoPoint> {
|
||||||
|
|
||||||
private final int precision;
|
private final int precision;
|
||||||
private final int requiredSize;
|
private final int requiredSize;
|
||||||
private final int shardSize;
|
private final int shardSize;
|
||||||
|
|
||||||
GeoTileGridAggregatorFactory(String name, ValuesSourceConfig<GeoPoint> config, int precision, int requiredSize,
|
GeoTileGridAggregatorFactory(String name, ValuesSourceConfig<GeoPoint> config, int precision, int requiredSize,
|
||||||
int shardSize, SearchContext context, AggregatorFactory<?> parent,
|
int shardSize, SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData
|
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData
|
||||||
) throws IOException {
|
) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class GlobalAggregationBuilder extends AbstractAggregationBuilder<GlobalA
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected AggregatorFactory<?> doBuild(SearchContext context, AggregatorFactory<?> parent, Builder subFactoriesBuilder)
|
protected AggregatorFactory doBuild(SearchContext context, AggregatorFactory parent, Builder subFactoriesBuilder)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
return new GlobalAggregatorFactory(name, context, parent, subFactoriesBuilder, metaData);
|
return new GlobalAggregatorFactory(name, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,9 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class GlobalAggregatorFactory extends AggregatorFactory<GlobalAggregatorFactory> {
|
public class GlobalAggregatorFactory extends AggregatorFactory {
|
||||||
|
|
||||||
public GlobalAggregatorFactory(String name, SearchContext context, AggregatorFactory<?> parent,
|
public GlobalAggregatorFactory(String name, SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactories, Map<String, Object> metaData) throws IOException {
|
AggregatorFactories.Builder subFactories, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, context, parent, subFactories, metaData);
|
super(name, context, parent, subFactories, metaData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,8 +184,8 @@ public class AutoDateHistogramAggregationBuilder
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ValuesSourceAggregatorFactory<Numeric, ?> innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
protected ValuesSourceAggregatorFactory<Numeric> innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
RoundingInfo[] roundings = buildRoundings(timeZone(), getMinimumIntervalExpression());
|
RoundingInfo[] roundings = buildRoundings(timeZone(), getMinimumIntervalExpression());
|
||||||
int maxRoundingInterval = Arrays.stream(roundings,0, roundings.length-1)
|
int maxRoundingInterval = Arrays.stream(roundings,0, roundings.length-1)
|
||||||
.map(rounding -> rounding.innerIntervals)
|
.map(rounding -> rounding.innerIntervals)
|
||||||
|
|
|
@ -35,7 +35,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public final class AutoDateHistogramAggregatorFactory
|
public final class AutoDateHistogramAggregatorFactory
|
||||||
extends ValuesSourceAggregatorFactory<ValuesSource.Numeric, AutoDateHistogramAggregatorFactory> {
|
extends ValuesSourceAggregatorFactory<ValuesSource.Numeric> {
|
||||||
|
|
||||||
private final int numBuckets;
|
private final int numBuckets;
|
||||||
private RoundingInfo[] roundingInfos;
|
private RoundingInfo[] roundingInfos;
|
||||||
|
@ -45,7 +45,7 @@ public final class AutoDateHistogramAggregatorFactory
|
||||||
int numBuckets,
|
int numBuckets,
|
||||||
RoundingInfo[] roundingInfos,
|
RoundingInfo[] roundingInfos,
|
||||||
SearchContext context,
|
SearchContext context,
|
||||||
AggregatorFactory<?> parent,
|
AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder,
|
AggregatorFactories.Builder subFactoriesBuilder,
|
||||||
Map<String, Object> metaData) throws IOException {
|
Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
|
|
|
@ -484,8 +484,8 @@ public class DateHistogramAggregationBuilder extends ValuesSourceAggregationBuil
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ValuesSourceAggregatorFactory<Numeric, ?> innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
protected ValuesSourceAggregatorFactory<Numeric> innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
final ZoneId tz = timeZone();
|
final ZoneId tz = timeZone();
|
||||||
final Rounding rounding = dateHistogramInterval.createRounding(tz);
|
final Rounding rounding = dateHistogramInterval.createRounding(tz);
|
||||||
final ZoneId rewrittenTimeZone = rewriteTimeZone(context.getQueryShardContext());
|
final ZoneId rewrittenTimeZone = rewriteTimeZone(context.getQueryShardContext());
|
||||||
|
|
|
@ -36,7 +36,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public final class DateHistogramAggregatorFactory
|
public final class DateHistogramAggregatorFactory
|
||||||
extends ValuesSourceAggregatorFactory<ValuesSource.Numeric, DateHistogramAggregatorFactory> {
|
extends ValuesSourceAggregatorFactory<ValuesSource.Numeric> {
|
||||||
|
|
||||||
private final long offset;
|
private final long offset;
|
||||||
private final BucketOrder order;
|
private final BucketOrder order;
|
||||||
|
@ -49,7 +49,7 @@ public final class DateHistogramAggregatorFactory
|
||||||
public DateHistogramAggregatorFactory(String name, ValuesSourceConfig<Numeric> config,
|
public DateHistogramAggregatorFactory(String name, ValuesSourceConfig<Numeric> config,
|
||||||
long offset, BucketOrder order, boolean keyed, long minDocCount,
|
long offset, BucketOrder order, boolean keyed, long minDocCount,
|
||||||
Rounding rounding, Rounding shardRounding, ExtendedBounds extendedBounds, SearchContext context,
|
Rounding rounding, Rounding shardRounding, ExtendedBounds extendedBounds, SearchContext context,
|
||||||
AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder,
|
AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder,
|
||||||
Map<String, Object> metaData) throws IOException {
|
Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
this.offset = offset;
|
this.offset = offset;
|
||||||
|
|
|
@ -295,8 +295,8 @@ public class HistogramAggregationBuilder extends ValuesSourceAggregationBuilder<
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ValuesSourceAggregatorFactory<Numeric, ?> innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
protected ValuesSourceAggregatorFactory<Numeric> innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
return new HistogramAggregatorFactory(name, config, interval, offset, order, keyed, minDocCount, minBound, maxBound,
|
return new HistogramAggregatorFactory(name, config, interval, offset, order, keyed, minDocCount, minBound, maxBound,
|
||||||
context, parent, subFactoriesBuilder, metaData);
|
context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public final class HistogramAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.Numeric, HistogramAggregatorFactory> {
|
public final class HistogramAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.Numeric> {
|
||||||
|
|
||||||
private final double interval, offset;
|
private final double interval, offset;
|
||||||
private final BucketOrder order;
|
private final BucketOrder order;
|
||||||
|
@ -44,7 +44,7 @@ public final class HistogramAggregatorFactory extends ValuesSourceAggregatorFact
|
||||||
|
|
||||||
public HistogramAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, double interval, double offset,
|
public HistogramAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, double interval, double offset,
|
||||||
BucketOrder order, boolean keyed, long minDocCount, double minBound, double maxBound,
|
BucketOrder order, boolean keyed, long minDocCount, double minBound, double maxBound,
|
||||||
SearchContext context, AggregatorFactory<?> parent,
|
SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
this.interval = interval;
|
this.interval = interval;
|
||||||
|
|
|
@ -83,8 +83,8 @@ public class MissingAggregationBuilder extends ValuesSourceAggregationBuilder<Va
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ValuesSourceAggregatorFactory<ValuesSource, ?> innerBuild(SearchContext context,
|
protected ValuesSourceAggregatorFactory<ValuesSource> innerBuild(SearchContext context,
|
||||||
ValuesSourceConfig<ValuesSource> config, AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
ValuesSourceConfig<ValuesSource> config, AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
return new MissingAggregatorFactory(name, config, context, parent, subFactoriesBuilder, metaData);
|
return new MissingAggregatorFactory(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,10 +32,10 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class MissingAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource, MissingAggregatorFactory> {
|
public class MissingAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource> {
|
||||||
|
|
||||||
public MissingAggregatorFactory(String name, ValuesSourceConfig<ValuesSource> config, SearchContext context,
|
public MissingAggregatorFactory(String name, ValuesSourceConfig<ValuesSource> config, SearchContext context,
|
||||||
AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ public class NestedAggregationBuilder extends AbstractAggregationBuilder<NestedA
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected AggregatorFactory<?> doBuild(SearchContext context, AggregatorFactory<?> parent, Builder subFactoriesBuilder)
|
protected AggregatorFactory doBuild(SearchContext context, AggregatorFactory parent, Builder subFactoriesBuilder)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
ObjectMapper childObjectMapper = context.getObjectMapper(path);
|
ObjectMapper childObjectMapper = context.getObjectMapper(path);
|
||||||
if (childObjectMapper == null) {
|
if (childObjectMapper == null) {
|
||||||
|
|
|
@ -32,13 +32,13 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class NestedAggregatorFactory extends AggregatorFactory<NestedAggregatorFactory> {
|
public class NestedAggregatorFactory extends AggregatorFactory {
|
||||||
|
|
||||||
private final ObjectMapper parentObjectMapper;
|
private final ObjectMapper parentObjectMapper;
|
||||||
private final ObjectMapper childObjectMapper;
|
private final ObjectMapper childObjectMapper;
|
||||||
|
|
||||||
NestedAggregatorFactory(String name, ObjectMapper parentObjectMapper, ObjectMapper childObjectMapper,
|
NestedAggregatorFactory(String name, ObjectMapper parentObjectMapper, ObjectMapper childObjectMapper,
|
||||||
SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactories,
|
SearchContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactories,
|
||||||
Map<String, Object> metaData) throws IOException {
|
Map<String, Object> metaData) throws IOException {
|
||||||
super(name, context, parent, subFactories, metaData);
|
super(name, context, parent, subFactories, metaData);
|
||||||
this.parentObjectMapper = parentObjectMapper;
|
this.parentObjectMapper = parentObjectMapper;
|
||||||
|
|
|
@ -92,7 +92,7 @@ public class ReverseNestedAggregationBuilder extends AbstractAggregationBuilder<
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected AggregatorFactory<?> doBuild(SearchContext context, AggregatorFactory<?> parent, Builder subFactoriesBuilder)
|
protected AggregatorFactory doBuild(SearchContext context, AggregatorFactory parent, Builder subFactoriesBuilder)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
if (findNestedAggregatorFactory(parent) == null) {
|
if (findNestedAggregatorFactory(parent) == null) {
|
||||||
throw new SearchParseException(context,
|
throw new SearchParseException(context,
|
||||||
|
@ -120,7 +120,7 @@ public class ReverseNestedAggregationBuilder extends AbstractAggregationBuilder<
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static NestedAggregatorFactory findNestedAggregatorFactory(AggregatorFactory<?> parent) {
|
private static NestedAggregatorFactory findNestedAggregatorFactory(AggregatorFactory parent) {
|
||||||
if (parent == null) {
|
if (parent == null) {
|
||||||
return null;
|
return null;
|
||||||
} else if (parent instanceof NestedAggregatorFactory) {
|
} else if (parent instanceof NestedAggregatorFactory) {
|
||||||
|
|
|
@ -32,13 +32,13 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class ReverseNestedAggregatorFactory extends AggregatorFactory<ReverseNestedAggregatorFactory> {
|
public class ReverseNestedAggregatorFactory extends AggregatorFactory {
|
||||||
|
|
||||||
private final boolean unmapped;
|
private final boolean unmapped;
|
||||||
private final ObjectMapper parentObjectMapper;
|
private final ObjectMapper parentObjectMapper;
|
||||||
|
|
||||||
public ReverseNestedAggregatorFactory(String name, boolean unmapped, ObjectMapper parentObjectMapper,
|
public ReverseNestedAggregatorFactory(String name, boolean unmapped, ObjectMapper parentObjectMapper,
|
||||||
SearchContext context, AggregatorFactory<?> parent,
|
SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactories,
|
AggregatorFactories.Builder subFactories,
|
||||||
Map<String, Object> metaData) throws IOException {
|
Map<String, Object> metaData) throws IOException {
|
||||||
super(name, context, parent, subFactories, metaData);
|
super(name, context, parent, subFactories, metaData);
|
||||||
|
|
|
@ -35,15 +35,14 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class AbstractRangeAggregatorFactory<AF extends AbstractRangeAggregatorFactory<AF, R>, R extends Range>
|
public class AbstractRangeAggregatorFactory<R extends Range> extends ValuesSourceAggregatorFactory<ValuesSource.Numeric> {
|
||||||
extends ValuesSourceAggregatorFactory<ValuesSource.Numeric, AF> {
|
|
||||||
|
|
||||||
private final InternalRange.Factory<?, ?> rangeFactory;
|
private final InternalRange.Factory<?, ?> rangeFactory;
|
||||||
private final R[] ranges;
|
private final R[] ranges;
|
||||||
private final boolean keyed;
|
private final boolean keyed;
|
||||||
|
|
||||||
public AbstractRangeAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, R[] ranges, boolean keyed,
|
public AbstractRangeAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, R[] ranges, boolean keyed,
|
||||||
InternalRange.Factory<?, ?> rangeFactory, SearchContext context, AggregatorFactory<?> parent,
|
InternalRange.Factory<?, ?> rangeFactory, SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
this.ranges = ranges;
|
this.ranges = ranges;
|
||||||
|
|
|
@ -32,7 +32,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class BinaryRangeAggregatorFactory
|
public class BinaryRangeAggregatorFactory
|
||||||
extends ValuesSourceAggregatorFactory<ValuesSource.Bytes, BinaryRangeAggregatorFactory> {
|
extends ValuesSourceAggregatorFactory<ValuesSource.Bytes> {
|
||||||
|
|
||||||
private final List<BinaryRangeAggregator.Range> ranges;
|
private final List<BinaryRangeAggregator.Range> ranges;
|
||||||
private final boolean keyed;
|
private final boolean keyed;
|
||||||
|
@ -41,7 +41,7 @@ public class BinaryRangeAggregatorFactory
|
||||||
ValuesSourceConfig<ValuesSource.Bytes> config,
|
ValuesSourceConfig<ValuesSource.Bytes> config,
|
||||||
List<BinaryRangeAggregator.Range> ranges, boolean keyed,
|
List<BinaryRangeAggregator.Range> ranges, boolean keyed,
|
||||||
SearchContext context,
|
SearchContext context,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder,
|
AggregatorFactory parent, Builder subFactoriesBuilder,
|
||||||
Map<String, Object> metaData) throws IOException {
|
Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
this.ranges = ranges;
|
this.ranges = ranges;
|
||||||
|
|
|
@ -289,7 +289,7 @@ public class DateRangeAggregationBuilder extends AbstractRangeBuilder<DateRangeA
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected DateRangeAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
protected DateRangeAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
// We need to call processRanges here so they are parsed and we know whether `now` has been used before we make
|
// We need to call processRanges here so they are parsed and we know whether `now` has been used before we make
|
||||||
// the decision of whether to cache the request
|
// the decision of whether to cache the request
|
||||||
RangeAggregator.Range[] ranges = processRanges(range -> {
|
RangeAggregator.Range[] ranges = processRanges(range -> {
|
||||||
|
|
|
@ -28,10 +28,10 @@ import org.elasticsearch.search.internal.SearchContext;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class DateRangeAggregatorFactory extends AbstractRangeAggregatorFactory<DateRangeAggregatorFactory, RangeAggregator.Range> {
|
public class DateRangeAggregatorFactory extends AbstractRangeAggregatorFactory<RangeAggregator.Range> {
|
||||||
|
|
||||||
public DateRangeAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, RangeAggregator.Range[] ranges, boolean keyed,
|
public DateRangeAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, RangeAggregator.Range[] ranges, boolean keyed,
|
||||||
InternalRange.Factory<?, ?> rangeFactory, SearchContext context, AggregatorFactory<?> parent,
|
InternalRange.Factory<?, ?> rangeFactory, SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, ranges, keyed, rangeFactory, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, ranges, keyed, rangeFactory, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -411,8 +411,8 @@ public class GeoDistanceAggregationBuilder extends ValuesSourceAggregationBuilde
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ValuesSourceAggregatorFactory<ValuesSource.GeoPoint, ?> innerBuild(SearchContext context,
|
protected ValuesSourceAggregatorFactory<ValuesSource.GeoPoint> innerBuild(SearchContext context,
|
||||||
ValuesSourceConfig<ValuesSource.GeoPoint> config, AggregatorFactory<?> parent, Builder subFactoriesBuilder)
|
ValuesSourceConfig<ValuesSource.GeoPoint> config, AggregatorFactory parent, Builder subFactoriesBuilder)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
Range[] ranges = this.ranges.toArray(new Range[this.range().size()]);
|
Range[] ranges = this.ranges.toArray(new Range[this.range().size()]);
|
||||||
if (ranges.length == 0) {
|
if (ranges.length == 0) {
|
||||||
|
|
|
@ -43,7 +43,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class GeoDistanceRangeAggregatorFactory
|
public class GeoDistanceRangeAggregatorFactory
|
||||||
extends ValuesSourceAggregatorFactory<ValuesSource.GeoPoint, GeoDistanceRangeAggregatorFactory> {
|
extends ValuesSourceAggregatorFactory<ValuesSource.GeoPoint> {
|
||||||
|
|
||||||
private final InternalRange.Factory<InternalGeoDistance.Bucket, InternalGeoDistance> rangeFactory = InternalGeoDistance.FACTORY;
|
private final InternalRange.Factory<InternalGeoDistance.Bucket, InternalGeoDistance> rangeFactory = InternalGeoDistance.FACTORY;
|
||||||
private final GeoPoint origin;
|
private final GeoPoint origin;
|
||||||
|
@ -54,7 +54,7 @@ public class GeoDistanceRangeAggregatorFactory
|
||||||
|
|
||||||
public GeoDistanceRangeAggregatorFactory(String name, ValuesSourceConfig<ValuesSource.GeoPoint> config, GeoPoint origin,
|
public GeoDistanceRangeAggregatorFactory(String name, ValuesSourceConfig<ValuesSource.GeoPoint> config, GeoPoint origin,
|
||||||
Range[] ranges, DistanceUnit unit, GeoDistance distanceType, boolean keyed, SearchContext context,
|
Range[] ranges, DistanceUnit unit, GeoDistance distanceType, boolean keyed, SearchContext context,
|
||||||
AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
this.origin = origin;
|
this.origin = origin;
|
||||||
this.ranges = ranges;
|
this.ranges = ranges;
|
||||||
|
|
|
@ -364,9 +364,9 @@ public final class IpRangeAggregationBuilder
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ValuesSourceAggregatorFactory<ValuesSource.Bytes, ?> innerBuild(
|
protected ValuesSourceAggregatorFactory<ValuesSource.Bytes> innerBuild(
|
||||||
SearchContext context, ValuesSourceConfig<ValuesSource.Bytes> config,
|
SearchContext context, ValuesSourceConfig<ValuesSource.Bytes> config,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder)
|
AggregatorFactory parent, Builder subFactoriesBuilder)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
List<BinaryRangeAggregator.Range> ranges = new ArrayList<>();
|
List<BinaryRangeAggregator.Range> ranges = new ArrayList<>();
|
||||||
if(this.ranges.size() == 0){
|
if(this.ranges.size() == 0){
|
||||||
|
|
|
@ -147,7 +147,7 @@ public class RangeAggregationBuilder extends AbstractRangeBuilder<RangeAggregati
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected RangeAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
protected RangeAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
// We need to call processRanges here so they are parsed before we make the decision of whether to cache the request
|
// We need to call processRanges here so they are parsed before we make the decision of whether to cache the request
|
||||||
Range[] ranges = processRanges(range -> {
|
Range[] ranges = processRanges(range -> {
|
||||||
DocValueFormat parser = config.format();
|
DocValueFormat parser = config.format();
|
||||||
|
|
|
@ -30,10 +30,10 @@ import org.elasticsearch.search.internal.SearchContext;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class RangeAggregatorFactory extends AbstractRangeAggregatorFactory<RangeAggregatorFactory, RangeAggregator.Range> {
|
public class RangeAggregatorFactory extends AbstractRangeAggregatorFactory<RangeAggregator.Range> {
|
||||||
|
|
||||||
public RangeAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, Range[] ranges, boolean keyed,
|
public RangeAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, Range[] ranges, boolean keyed,
|
||||||
Factory<?, ?> rangeFactory, SearchContext context, AggregatorFactory<?> parent,
|
Factory<?, ?> rangeFactory, SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, ranges, keyed, rangeFactory, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, ranges, keyed, rangeFactory, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,8 +148,8 @@ public class DiversifiedAggregationBuilder extends ValuesSourceAggregationBuilde
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ValuesSourceAggregatorFactory<ValuesSource, ?> innerBuild(SearchContext context,
|
protected ValuesSourceAggregatorFactory<ValuesSource> innerBuild(SearchContext context,
|
||||||
ValuesSourceConfig<ValuesSource> config, AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
ValuesSourceConfig<ValuesSource> config, AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
return new DiversifiedAggregatorFactory(name, config, shardSize, maxDocsPerValue, executionHint, context, parent,
|
return new DiversifiedAggregatorFactory(name, config, shardSize, maxDocsPerValue, executionHint, context, parent,
|
||||||
subFactoriesBuilder, metaData);
|
subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,14 +37,14 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class DiversifiedAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource, DiversifiedAggregatorFactory> {
|
public class DiversifiedAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource> {
|
||||||
|
|
||||||
private final int shardSize;
|
private final int shardSize;
|
||||||
private final int maxDocsPerValue;
|
private final int maxDocsPerValue;
|
||||||
private final String executionHint;
|
private final String executionHint;
|
||||||
|
|
||||||
DiversifiedAggregatorFactory(String name, ValuesSourceConfig<ValuesSource> config, int shardSize, int maxDocsPerValue,
|
DiversifiedAggregatorFactory(String name, ValuesSourceConfig<ValuesSource> config, int shardSize, int maxDocsPerValue,
|
||||||
String executionHint, SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder,
|
String executionHint, SearchContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder,
|
||||||
Map<String, Object> metaData) throws IOException {
|
Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
this.shardSize = shardSize;
|
this.shardSize = shardSize;
|
||||||
|
|
|
@ -84,7 +84,7 @@ public class SamplerAggregationBuilder extends AbstractAggregationBuilder<Sample
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SamplerAggregatorFactory doBuild(SearchContext context, AggregatorFactory<?> parent, Builder subFactoriesBuilder)
|
protected SamplerAggregatorFactory doBuild(SearchContext context, AggregatorFactory parent, Builder subFactoriesBuilder)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
return new SamplerAggregatorFactory(name, shardSize, context, parent, subFactoriesBuilder, metaData);
|
return new SamplerAggregatorFactory(name, shardSize, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,11 +29,11 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class SamplerAggregatorFactory extends AggregatorFactory<SamplerAggregatorFactory> {
|
public class SamplerAggregatorFactory extends AggregatorFactory {
|
||||||
|
|
||||||
private final int shardSize;
|
private final int shardSize;
|
||||||
|
|
||||||
SamplerAggregatorFactory(String name, int shardSize, SearchContext context, AggregatorFactory<?> parent,
|
SamplerAggregatorFactory(String name, int shardSize, SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactories, Map<String, Object> metaData) throws IOException {
|
AggregatorFactories.Builder subFactories, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, context, parent, subFactories, metaData);
|
super(name, context, parent, subFactories, metaData);
|
||||||
this.shardSize = shardSize;
|
this.shardSize = shardSize;
|
||||||
|
|
|
@ -283,8 +283,8 @@ public class SignificantTermsAggregationBuilder extends ValuesSourceAggregationB
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ValuesSourceAggregatorFactory<ValuesSource, ?> innerBuild(SearchContext context, ValuesSourceConfig<ValuesSource> config,
|
protected ValuesSourceAggregatorFactory<ValuesSource> innerBuild(SearchContext context, ValuesSourceConfig<ValuesSource> config,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
SignificanceHeuristic executionHeuristic = this.significanceHeuristic.rewrite(context);
|
SignificanceHeuristic executionHeuristic = this.significanceHeuristic.rewrite(context);
|
||||||
return new SignificantTermsAggregatorFactory(name, config, includeExclude, executionHint, filterBuilder,
|
return new SignificantTermsAggregatorFactory(name, config, includeExclude, executionHint, filterBuilder,
|
||||||
bucketCountThresholds, executionHeuristic, context, parent, subFactoriesBuilder, metaData);
|
bucketCountThresholds, executionHeuristic, context, parent, subFactoriesBuilder, metaData);
|
||||||
|
|
|
@ -58,7 +58,7 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class SignificantTermsAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource, SignificantTermsAggregatorFactory>
|
public class SignificantTermsAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource>
|
||||||
implements Releasable {
|
implements Releasable {
|
||||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
|
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
|
||||||
LogManager.getLogger(SignificantTermsAggregatorFactory.class));
|
LogManager.getLogger(SignificantTermsAggregatorFactory.class));
|
||||||
|
@ -82,7 +82,7 @@ public class SignificantTermsAggregatorFactory extends ValuesSourceAggregatorFac
|
||||||
TermsAggregator.BucketCountThresholds bucketCountThresholds,
|
TermsAggregator.BucketCountThresholds bucketCountThresholds,
|
||||||
SignificanceHeuristic significanceHeuristic,
|
SignificanceHeuristic significanceHeuristic,
|
||||||
SearchContext context,
|
SearchContext context,
|
||||||
AggregatorFactory<?> parent,
|
AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder,
|
AggregatorFactories.Builder subFactoriesBuilder,
|
||||||
Map<String, Object> metaData) throws IOException {
|
Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
|
|
|
@ -340,7 +340,7 @@ public class SignificantTextAggregationBuilder extends AbstractAggregationBuilde
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected AggregatorFactory<?> doBuild(SearchContext context, AggregatorFactory<?> parent,
|
protected AggregatorFactory doBuild(SearchContext context, AggregatorFactory parent,
|
||||||
Builder subFactoriesBuilder) throws IOException {
|
Builder subFactoriesBuilder) throws IOException {
|
||||||
SignificanceHeuristic executionHeuristic = this.significanceHeuristic.rewrite(context);
|
SignificanceHeuristic executionHeuristic = this.significanceHeuristic.rewrite(context);
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class SignificantTextAggregatorFactory extends AggregatorFactory<SignificantTextAggregatorFactory>
|
public class SignificantTextAggregatorFactory extends AggregatorFactory
|
||||||
implements Releasable {
|
implements Releasable {
|
||||||
|
|
||||||
private final IncludeExclude includeExclude;
|
private final IncludeExclude includeExclude;
|
||||||
|
@ -67,7 +67,7 @@ public class SignificantTextAggregatorFactory extends AggregatorFactory<Signific
|
||||||
|
|
||||||
public SignificantTextAggregatorFactory(String name, IncludeExclude includeExclude,
|
public SignificantTextAggregatorFactory(String name, IncludeExclude includeExclude,
|
||||||
QueryBuilder filterBuilder, TermsAggregator.BucketCountThresholds bucketCountThresholds,
|
QueryBuilder filterBuilder, TermsAggregator.BucketCountThresholds bucketCountThresholds,
|
||||||
SignificanceHeuristic significanceHeuristic, SearchContext context, AggregatorFactory<?> parent,
|
SignificanceHeuristic significanceHeuristic, SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder, String fieldName, String [] sourceFieldNames,
|
AggregatorFactories.Builder subFactoriesBuilder, String fieldName, String [] sourceFieldNames,
|
||||||
boolean filterDuplicateText, Map<String, Object> metaData) throws IOException {
|
boolean filterDuplicateText, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, context, parent, subFactoriesBuilder, metaData);
|
super(name, context, parent, subFactoriesBuilder, metaData);
|
||||||
|
|
|
@ -161,9 +161,9 @@ public class RareTermsAggregationBuilder extends ValuesSourceAggregationBuilder<
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ValuesSourceAggregatorFactory<ValuesSource, ?> innerBuild(SearchContext context,
|
protected ValuesSourceAggregatorFactory<ValuesSource> innerBuild(SearchContext context,
|
||||||
ValuesSourceConfig<ValuesSource> config,
|
ValuesSourceConfig<ValuesSource> config,
|
||||||
AggregatorFactory<?> parent,
|
AggregatorFactory parent,
|
||||||
Builder subFactoriesBuilder) throws IOException {
|
Builder subFactoriesBuilder) throws IOException {
|
||||||
return new RareTermsAggregatorFactory(name, config, includeExclude,
|
return new RareTermsAggregatorFactory(name, config, includeExclude,
|
||||||
context, parent, subFactoriesBuilder, metaData, maxDocCount, precision);
|
context, parent, subFactoriesBuilder, metaData, maxDocCount, precision);
|
||||||
|
|
|
@ -38,7 +38,7 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class RareTermsAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource, RareTermsAggregatorFactory> {
|
public class RareTermsAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource> {
|
||||||
private final IncludeExclude includeExclude;
|
private final IncludeExclude includeExclude;
|
||||||
private final int maxDocCount;
|
private final int maxDocCount;
|
||||||
private final double precision;
|
private final double precision;
|
||||||
|
@ -46,7 +46,7 @@ public class RareTermsAggregatorFactory extends ValuesSourceAggregatorFactory<Va
|
||||||
RareTermsAggregatorFactory(String name, ValuesSourceConfig<ValuesSource> config,
|
RareTermsAggregatorFactory(String name, ValuesSourceConfig<ValuesSource> config,
|
||||||
IncludeExclude includeExclude,
|
IncludeExclude includeExclude,
|
||||||
SearchContext context,
|
SearchContext context,
|
||||||
AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder,
|
AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder,
|
||||||
Map<String, Object> metaData, int maxDocCount, double precision) throws IOException {
|
Map<String, Object> metaData, int maxDocCount, double precision) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
this.includeExclude = includeExclude;
|
this.includeExclude = includeExclude;
|
||||||
|
|
|
@ -333,8 +333,8 @@ public class TermsAggregationBuilder extends ValuesSourceAggregationBuilder<Valu
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ValuesSourceAggregatorFactory<ValuesSource, ?> innerBuild(SearchContext context, ValuesSourceConfig<ValuesSource> config,
|
protected ValuesSourceAggregatorFactory<ValuesSource> innerBuild(SearchContext context, ValuesSourceConfig<ValuesSource> config,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
return new TermsAggregatorFactory(name, config, order, includeExclude, executionHint, collectMode,
|
return new TermsAggregatorFactory(name, config, order, includeExclude, executionHint, collectMode,
|
||||||
bucketCountThresholds, showTermDocCountError, context, parent, subFactoriesBuilder, metaData);
|
bucketCountThresholds, showTermDocCountError, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class TermsAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource, TermsAggregatorFactory> {
|
public class TermsAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource> {
|
||||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(TermsAggregatorFactory.class));
|
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(TermsAggregatorFactory.class));
|
||||||
|
|
||||||
static Boolean REMAP_GLOBAL_ORDS, COLLECT_SEGMENT_ORDS;
|
static Boolean REMAP_GLOBAL_ORDS, COLLECT_SEGMENT_ORDS;
|
||||||
|
@ -67,7 +67,7 @@ public class TermsAggregatorFactory extends ValuesSourceAggregatorFactory<Values
|
||||||
TermsAggregator.BucketCountThresholds bucketCountThresholds,
|
TermsAggregator.BucketCountThresholds bucketCountThresholds,
|
||||||
boolean showTermDocCountError,
|
boolean showTermDocCountError,
|
||||||
SearchContext context,
|
SearchContext context,
|
||||||
AggregatorFactory<?> parent,
|
AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder,
|
AggregatorFactories.Builder subFactoriesBuilder,
|
||||||
Map<String, Object> metaData) throws IOException {
|
Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class AvgAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOn
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected AvgAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
protected AvgAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
return new AvgAggregatorFactory(name, config, context, parent, subFactoriesBuilder, metaData);
|
return new AvgAggregatorFactory(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,10 +33,10 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
class AvgAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.Numeric, AvgAggregatorFactory> {
|
class AvgAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.Numeric> {
|
||||||
|
|
||||||
AvgAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, SearchContext context,
|
AvgAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, SearchContext context,
|
||||||
AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,7 @@ public final class CardinalityAggregationBuilder
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CardinalityAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<ValuesSource> config,
|
protected CardinalityAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<ValuesSource> config,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
return new CardinalityAggregatorFactory(name, config, precisionThreshold, context, parent, subFactoriesBuilder, metaData);
|
return new CardinalityAggregatorFactory(name, config, precisionThreshold, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,12 +32,12 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
class CardinalityAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource, CardinalityAggregatorFactory> {
|
class CardinalityAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource> {
|
||||||
|
|
||||||
private final Long precisionThreshold;
|
private final Long precisionThreshold;
|
||||||
|
|
||||||
CardinalityAggregatorFactory(String name, ValuesSourceConfig<ValuesSource> config, Long precisionThreshold,
|
CardinalityAggregatorFactory(String name, ValuesSourceConfig<ValuesSource> config, Long precisionThreshold,
|
||||||
SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder,
|
SearchContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder,
|
||||||
Map<String, Object> metaData) throws IOException {
|
Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
this.precisionThreshold = precisionThreshold;
|
this.precisionThreshold = precisionThreshold;
|
||||||
|
|
|
@ -99,7 +99,7 @@ public class ExtendedStatsAggregationBuilder
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ExtendedStatsAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
protected ExtendedStatsAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
return new ExtendedStatsAggregatorFactory(name, config, sigma, context, parent, subFactoriesBuilder, metaData);
|
return new ExtendedStatsAggregatorFactory(name, config, sigma, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,12 +33,12 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
class ExtendedStatsAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.Numeric, ExtendedStatsAggregatorFactory> {
|
class ExtendedStatsAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.Numeric> {
|
||||||
|
|
||||||
private final double sigma;
|
private final double sigma;
|
||||||
|
|
||||||
ExtendedStatsAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, double sigma,
|
ExtendedStatsAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, double sigma,
|
||||||
SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder,
|
SearchContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder,
|
||||||
Map<String, Object> metaData) throws IOException {
|
Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
this.sigma = sigma;
|
this.sigma = sigma;
|
||||||
|
|
|
@ -99,7 +99,7 @@ public class GeoBoundsAggregationBuilder extends ValuesSourceAggregationBuilder<
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected GeoBoundsAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<ValuesSource.GeoPoint> config,
|
protected GeoBoundsAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<ValuesSource.GeoPoint> config,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
return new GeoBoundsAggregatorFactory(name, config, wrapLongitude, context, parent, subFactoriesBuilder, metaData);
|
return new GeoBoundsAggregatorFactory(name, config, wrapLongitude, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,12 +32,12 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
class GeoBoundsAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.GeoPoint, GeoBoundsAggregatorFactory> {
|
class GeoBoundsAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.GeoPoint> {
|
||||||
|
|
||||||
private final boolean wrapLongitude;
|
private final boolean wrapLongitude;
|
||||||
|
|
||||||
GeoBoundsAggregatorFactory(String name, ValuesSourceConfig<ValuesSource.GeoPoint> config, boolean wrapLongitude,
|
GeoBoundsAggregatorFactory(String name, ValuesSourceConfig<ValuesSource.GeoPoint> config, boolean wrapLongitude,
|
||||||
SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder,
|
SearchContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder,
|
||||||
Map<String, Object> metaData) throws IOException {
|
Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
this.wrapLongitude = wrapLongitude;
|
this.wrapLongitude = wrapLongitude;
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class GeoCentroidAggregationBuilder
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected GeoCentroidAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<ValuesSource.GeoPoint> config,
|
protected GeoCentroidAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<ValuesSource.GeoPoint> config,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
return new GeoCentroidAggregatorFactory(name, config, context, parent, subFactoriesBuilder, metaData);
|
return new GeoCentroidAggregatorFactory(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,10 +32,10 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
class GeoCentroidAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.GeoPoint, GeoCentroidAggregatorFactory> {
|
class GeoCentroidAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.GeoPoint> {
|
||||||
|
|
||||||
GeoCentroidAggregatorFactory(String name, ValuesSourceConfig<ValuesSource.GeoPoint> config,
|
GeoCentroidAggregatorFactory(String name, ValuesSourceConfig<ValuesSource.GeoPoint> config,
|
||||||
SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder,
|
SearchContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder,
|
||||||
Map<String, Object> metaData) throws IOException {
|
Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,14 +34,14 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
class HDRPercentileRanksAggregatorFactory
|
class HDRPercentileRanksAggregatorFactory
|
||||||
extends ValuesSourceAggregatorFactory<ValuesSource.Numeric, HDRPercentileRanksAggregatorFactory> {
|
extends ValuesSourceAggregatorFactory<ValuesSource.Numeric> {
|
||||||
|
|
||||||
private final double[] values;
|
private final double[] values;
|
||||||
private final int numberOfSignificantValueDigits;
|
private final int numberOfSignificantValueDigits;
|
||||||
private final boolean keyed;
|
private final boolean keyed;
|
||||||
|
|
||||||
HDRPercentileRanksAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, double[] values,
|
HDRPercentileRanksAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, double[] values,
|
||||||
int numberOfSignificantValueDigits, boolean keyed, SearchContext context, AggregatorFactory<?> parent,
|
int numberOfSignificantValueDigits, boolean keyed, SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
this.values = values;
|
this.values = values;
|
||||||
|
|
|
@ -33,14 +33,14 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
class HDRPercentilesAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.Numeric, HDRPercentilesAggregatorFactory> {
|
class HDRPercentilesAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.Numeric> {
|
||||||
|
|
||||||
private final double[] percents;
|
private final double[] percents;
|
||||||
private final int numberOfSignificantValueDigits;
|
private final int numberOfSignificantValueDigits;
|
||||||
private final boolean keyed;
|
private final boolean keyed;
|
||||||
|
|
||||||
HDRPercentilesAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, double[] percents,
|
HDRPercentilesAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, double[] percents,
|
||||||
int numberOfSignificantValueDigits, boolean keyed, SearchContext context, AggregatorFactory<?> parent,
|
int numberOfSignificantValueDigits, boolean keyed, SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
this.percents = percents;
|
this.percents = percents;
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class MaxAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOn
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected MaxAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
protected MaxAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
return new MaxAggregatorFactory(name, config, context, parent, subFactoriesBuilder, metaData);
|
return new MaxAggregatorFactory(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,10 +33,10 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
class MaxAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.Numeric, MaxAggregatorFactory> {
|
class MaxAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.Numeric> {
|
||||||
|
|
||||||
MaxAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, SearchContext context,
|
MaxAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, SearchContext context,
|
||||||
AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -107,9 +107,9 @@ public class MedianAbsoluteDeviationAggregationBuilder extends LeafOnly<ValuesSo
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ValuesSourceAggregatorFactory<ValuesSource.Numeric, ?> innerBuild(SearchContext context,
|
protected ValuesSourceAggregatorFactory<ValuesSource.Numeric> innerBuild(SearchContext context,
|
||||||
ValuesSourceConfig<ValuesSource.Numeric> config,
|
ValuesSourceConfig<ValuesSource.Numeric> config,
|
||||||
AggregatorFactory<?> parent,
|
AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder)
|
AggregatorFactories.Builder subFactoriesBuilder)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
|
||||||
|
|
|
@ -32,15 +32,14 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class MedianAbsoluteDeviationAggregatorFactory extends
|
public class MedianAbsoluteDeviationAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.Numeric> {
|
||||||
ValuesSourceAggregatorFactory<ValuesSource.Numeric, MedianAbsoluteDeviationAggregatorFactory> {
|
|
||||||
|
|
||||||
private final double compression;
|
private final double compression;
|
||||||
|
|
||||||
MedianAbsoluteDeviationAggregatorFactory(String name,
|
MedianAbsoluteDeviationAggregatorFactory(String name,
|
||||||
ValuesSourceConfig<ValuesSource.Numeric> config,
|
ValuesSourceConfig<ValuesSource.Numeric> config,
|
||||||
SearchContext context,
|
SearchContext context,
|
||||||
AggregatorFactory<?> parent,
|
AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder,
|
AggregatorFactories.Builder subFactoriesBuilder,
|
||||||
Map<String, Object> metaData,
|
Map<String, Object> metaData,
|
||||||
double compression) throws IOException {
|
double compression) throws IOException {
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class MinAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOn
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected MinAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
protected MinAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
return new MinAggregatorFactory(name, config, context, parent, subFactoriesBuilder, metaData);
|
return new MinAggregatorFactory(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,10 +33,10 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
class MinAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.Numeric, MinAggregatorFactory> {
|
class MinAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.Numeric> {
|
||||||
|
|
||||||
MinAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, SearchContext context,
|
MinAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, SearchContext context,
|
||||||
AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -240,8 +240,8 @@ public class PercentileRanksAggregationBuilder extends LeafOnly<ValuesSource.Num
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ValuesSourceAggregatorFactory<Numeric, ?> innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
protected ValuesSourceAggregatorFactory<Numeric> innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
switch (method) {
|
switch (method) {
|
||||||
case TDIGEST:
|
case TDIGEST:
|
||||||
return new TDigestPercentileRanksAggregatorFactory(name, config, values, compression, keyed, context, parent,
|
return new TDigestPercentileRanksAggregatorFactory(name, config, values, compression, keyed, context, parent,
|
||||||
|
|
|
@ -263,8 +263,8 @@ public class PercentilesAggregationBuilder extends LeafOnly<ValuesSource.Numeric
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ValuesSourceAggregatorFactory<Numeric, ?> innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
protected ValuesSourceAggregatorFactory<Numeric> innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
switch (method) {
|
switch (method) {
|
||||||
case TDIGEST:
|
case TDIGEST:
|
||||||
return new TDigestPercentilesAggregatorFactory(name, config, percents, compression, keyed, context, parent,
|
return new TDigestPercentilesAggregatorFactory(name, config, percents, compression, keyed, context, parent,
|
||||||
|
|
|
@ -193,7 +193,7 @@ public class ScriptedMetricAggregationBuilder extends AbstractAggregationBuilder
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ScriptedMetricAggregatorFactory doBuild(SearchContext context, AggregatorFactory<?> parent,
|
protected ScriptedMetricAggregatorFactory doBuild(SearchContext context, AggregatorFactory parent,
|
||||||
Builder subfactoriesBuilder) throws IOException {
|
Builder subfactoriesBuilder) throws IOException {
|
||||||
|
|
||||||
if (combineScript == null) {
|
if (combineScript == null) {
|
||||||
|
|
|
@ -36,7 +36,7 @@ import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
class ScriptedMetricAggregatorFactory extends AggregatorFactory<ScriptedMetricAggregatorFactory> {
|
class ScriptedMetricAggregatorFactory extends AggregatorFactory {
|
||||||
|
|
||||||
private final ScriptedMetricAggContexts.MapScript.Factory mapScript;
|
private final ScriptedMetricAggContexts.MapScript.Factory mapScript;
|
||||||
private final Map<String, Object> mapScriptParams;
|
private final Map<String, Object> mapScriptParams;
|
||||||
|
@ -53,7 +53,7 @@ class ScriptedMetricAggregatorFactory extends AggregatorFactory<ScriptedMetricAg
|
||||||
ScriptedMetricAggContexts.InitScript.Factory initScript, Map<String, Object> initScriptParams,
|
ScriptedMetricAggContexts.InitScript.Factory initScript, Map<String, Object> initScriptParams,
|
||||||
ScriptedMetricAggContexts.CombineScript.Factory combineScript,
|
ScriptedMetricAggContexts.CombineScript.Factory combineScript,
|
||||||
Map<String, Object> combineScriptParams, Script reduceScript, Map<String, Object> aggParams,
|
Map<String, Object> combineScriptParams, Script reduceScript, Map<String, Object> aggParams,
|
||||||
SearchLookup lookup, SearchContext context, AggregatorFactory<?> parent,
|
SearchLookup lookup, SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactories, Map<String, Object> metaData) throws IOException {
|
AggregatorFactories.Builder subFactories, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, context, parent, subFactories, metaData);
|
super(name, context, parent, subFactories, metaData);
|
||||||
this.mapScript = mapScript;
|
this.mapScript = mapScript;
|
||||||
|
|
|
@ -80,7 +80,7 @@ public class StatsAggregationBuilder extends ValuesSourceAggregationBuilder.Leaf
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected StatsAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
protected StatsAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
return new StatsAggregatorFactory(name, config, context, parent, subFactoriesBuilder, metaData);
|
return new StatsAggregatorFactory(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,10 +33,10 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
class StatsAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.Numeric, StatsAggregatorFactory> {
|
class StatsAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.Numeric> {
|
||||||
|
|
||||||
StatsAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, SearchContext context,
|
StatsAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, SearchContext context,
|
||||||
AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class SumAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOn
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SumAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
protected SumAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<Numeric> config,
|
||||||
AggregatorFactory<?> parent, Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {
|
||||||
return new SumAggregatorFactory(name, config, context, parent, subFactoriesBuilder, metaData);
|
return new SumAggregatorFactory(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,10 +33,10 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
class SumAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.Numeric, SumAggregatorFactory> {
|
class SumAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource.Numeric> {
|
||||||
|
|
||||||
SumAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, SearchContext context,
|
SumAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, SearchContext context,
|
||||||
AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,14 +34,14 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
class TDigestPercentileRanksAggregatorFactory
|
class TDigestPercentileRanksAggregatorFactory
|
||||||
extends ValuesSourceAggregatorFactory<ValuesSource.Numeric, TDigestPercentileRanksAggregatorFactory> {
|
extends ValuesSourceAggregatorFactory<ValuesSource.Numeric> {
|
||||||
|
|
||||||
private final double[] percents;
|
private final double[] percents;
|
||||||
private final double compression;
|
private final double compression;
|
||||||
private final boolean keyed;
|
private final boolean keyed;
|
||||||
|
|
||||||
TDigestPercentileRanksAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, double[] percents,
|
TDigestPercentileRanksAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, double[] percents,
|
||||||
double compression, boolean keyed, SearchContext context, AggregatorFactory<?> parent,
|
double compression, boolean keyed, SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
this.percents = percents;
|
this.percents = percents;
|
||||||
|
|
|
@ -34,14 +34,14 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
class TDigestPercentilesAggregatorFactory
|
class TDigestPercentilesAggregatorFactory
|
||||||
extends ValuesSourceAggregatorFactory<ValuesSource.Numeric, TDigestPercentilesAggregatorFactory> {
|
extends ValuesSourceAggregatorFactory<ValuesSource.Numeric> {
|
||||||
|
|
||||||
private final double[] percents;
|
private final double[] percents;
|
||||||
private final double compression;
|
private final double compression;
|
||||||
private final boolean keyed;
|
private final boolean keyed;
|
||||||
|
|
||||||
TDigestPercentilesAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, double[] percents,
|
TDigestPercentilesAggregatorFactory(String name, ValuesSourceConfig<Numeric> config, double[] percents,
|
||||||
double compression, boolean keyed, SearchContext context, AggregatorFactory<?> parent,
|
double compression, boolean keyed, SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
this.percents = percents;
|
this.percents = percents;
|
||||||
|
|
|
@ -577,7 +577,7 @@ public class TopHitsAggregationBuilder extends AbstractAggregationBuilder<TopHit
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TopHitsAggregatorFactory doBuild(SearchContext context, AggregatorFactory<?> parent, Builder subfactoriesBuilder)
|
protected TopHitsAggregatorFactory doBuild(SearchContext context, AggregatorFactory parent, Builder subfactoriesBuilder)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
long innerResultWindow = from() + size();
|
long innerResultWindow = from() + size();
|
||||||
int maxInnerResultWindow = context.mapperService().getIndexSettings().getMaxInnerResultWindow();
|
int maxInnerResultWindow = context.mapperService().getIndexSettings().getMaxInnerResultWindow();
|
||||||
|
|
|
@ -38,7 +38,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
class TopHitsAggregatorFactory extends AggregatorFactory<TopHitsAggregatorFactory> {
|
class TopHitsAggregatorFactory extends AggregatorFactory {
|
||||||
|
|
||||||
private final int from;
|
private final int from;
|
||||||
private final int size;
|
private final int size;
|
||||||
|
@ -56,7 +56,7 @@ class TopHitsAggregatorFactory extends AggregatorFactory<TopHitsAggregatorFactor
|
||||||
TopHitsAggregatorFactory(String name, int from, int size, boolean explain, boolean version, boolean seqNoAndPrimaryTerm,
|
TopHitsAggregatorFactory(String name, int from, int size, boolean explain, boolean version, boolean seqNoAndPrimaryTerm,
|
||||||
boolean trackScores, Optional<SortAndFormats> sort, HighlightBuilder highlightBuilder, StoredFieldsContext storedFieldsContext,
|
boolean trackScores, Optional<SortAndFormats> sort, HighlightBuilder highlightBuilder, StoredFieldsContext storedFieldsContext,
|
||||||
List<FieldAndFormat> docValueFields, List<ScriptFieldsContext.ScriptField> scriptFields, FetchSourceContext fetchSourceContext,
|
List<FieldAndFormat> docValueFields, List<ScriptFieldsContext.ScriptField> scriptFields, FetchSourceContext fetchSourceContext,
|
||||||
SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactories, Map<String, Object> metaData)
|
SearchContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactories, Map<String, Object> metaData)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
super(name, context, parent, subFactories, metaData);
|
super(name, context, parent, subFactories, metaData);
|
||||||
this.from = from;
|
this.from = from;
|
||||||
|
|
|
@ -84,7 +84,7 @@ public class ValueCountAggregationBuilder extends ValuesSourceAggregationBuilder
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ValueCountAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<ValuesSource> config,
|
protected ValueCountAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<ValuesSource> config,
|
||||||
AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder) throws IOException {
|
AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder) throws IOException {
|
||||||
return new ValueCountAggregatorFactory(name, config, context, parent, subFactoriesBuilder, metaData);
|
return new ValueCountAggregatorFactory(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,10 +32,10 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
class ValueCountAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource, ValueCountAggregatorFactory> {
|
class ValueCountAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource> {
|
||||||
|
|
||||||
ValueCountAggregatorFactory(String name, ValuesSourceConfig<ValuesSource> config, SearchContext context,
|
ValueCountAggregatorFactory(String name, ValuesSourceConfig<ValuesSource> config, SearchContext context,
|
||||||
AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metaData) throws IOException {
|
||||||
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
super(name, config, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,10 +98,10 @@ public class WeightedAvgAggregationBuilder extends MultiValuesSourceAggregationB
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected MultiValuesSourceAggregatorFactory<Numeric, ?> innerBuild(SearchContext context,
|
protected MultiValuesSourceAggregatorFactory<Numeric> innerBuild(SearchContext context,
|
||||||
Map<String, ValuesSourceConfig<Numeric>> configs,
|
Map<String, ValuesSourceConfig<Numeric>> configs,
|
||||||
DocValueFormat format,
|
DocValueFormat format,
|
||||||
AggregatorFactory<?> parent,
|
AggregatorFactory parent,
|
||||||
Builder subFactoriesBuilder) throws IOException {
|
Builder subFactoriesBuilder) throws IOException {
|
||||||
return new WeightedAvgAggregatorFactory(name, configs, format, context, parent, subFactoriesBuilder, metaData);
|
return new WeightedAvgAggregatorFactory(name, configs, format, context, parent, subFactoriesBuilder, metaData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,10 +34,10 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
class WeightedAvgAggregatorFactory extends MultiValuesSourceAggregatorFactory<Numeric, WeightedAvgAggregatorFactory> {
|
class WeightedAvgAggregatorFactory extends MultiValuesSourceAggregatorFactory<Numeric> {
|
||||||
|
|
||||||
WeightedAvgAggregatorFactory(String name, Map<String, ValuesSourceConfig<Numeric>> configs,
|
WeightedAvgAggregatorFactory(String name, Map<String, ValuesSourceConfig<Numeric>> configs,
|
||||||
DocValueFormat format, SearchContext context, AggregatorFactory<?> parent,
|
DocValueFormat format, SearchContext context, AggregatorFactory parent,
|
||||||
AggregatorFactories.Builder subFactoriesBuilder,
|
AggregatorFactories.Builder subFactoriesBuilder,
|
||||||
Map<String, Object> metaData) throws IOException {
|
Map<String, Object> metaData) throws IOException {
|
||||||
super(name, configs, format, context, parent, subFactoriesBuilder, metaData);
|
super(name, configs, format, context, parent, subFactoriesBuilder, metaData);
|
||||||
|
|
|
@ -84,7 +84,7 @@ public abstract class AbstractPipelineAggregationBuilder<PAB extends AbstractPip
|
||||||
* configured)
|
* configured)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public final void validate(AggregatorFactory<?> parent, Collection<AggregationBuilder> factories,
|
public final void validate(AggregatorFactory parent, Collection<AggregationBuilder> factories,
|
||||||
Collection<PipelineAggregationBuilder> pipelineAggregatorFactories) {
|
Collection<PipelineAggregationBuilder> pipelineAggregatorFactories) {
|
||||||
doValidate(parent, factories, pipelineAggregatorFactories);
|
doValidate(parent, factories, pipelineAggregatorFactories);
|
||||||
}
|
}
|
||||||
|
@ -102,14 +102,14 @@ public abstract class AbstractPipelineAggregationBuilder<PAB extends AbstractPip
|
||||||
return aggregator;
|
return aggregator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void doValidate(AggregatorFactory<?> parent, Collection<AggregationBuilder> factories,
|
public void doValidate(AggregatorFactory parent, Collection<AggregationBuilder> factories,
|
||||||
Collection<PipelineAggregationBuilder> pipelineAggregatorFactories) {
|
Collection<PipelineAggregationBuilder> pipelineAggregatorFactories) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates pipeline aggregations that need sequentially ordered data.
|
* Validates pipeline aggregations that need sequentially ordered data.
|
||||||
*/
|
*/
|
||||||
public static void validateSequentiallyOrderedParentAggs(AggregatorFactory<?> parent, String type, String name) {
|
public static void validateSequentiallyOrderedParentAggs(AggregatorFactory parent, String type, String name) {
|
||||||
if ((parent instanceof HistogramAggregatorFactory || parent instanceof DateHistogramAggregatorFactory
|
if ((parent instanceof HistogramAggregatorFactory || parent instanceof DateHistogramAggregatorFactory
|
||||||
|| parent instanceof AutoDateHistogramAggregatorFactory) == false) {
|
|| parent instanceof AutoDateHistogramAggregatorFactory) == false) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
|
|
|
@ -107,7 +107,7 @@ public abstract class BucketMetricsPipelineAggregationBuilder<AF extends BucketM
|
||||||
protected abstract PipelineAggregator createInternal(Map<String, Object> metaData);
|
protected abstract PipelineAggregator createInternal(Map<String, Object> metaData);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doValidate(AggregatorFactory<?> parent, Collection<AggregationBuilder> aggBuilders,
|
public void doValidate(AggregatorFactory parent, Collection<AggregationBuilder> aggBuilders,
|
||||||
Collection<PipelineAggregationBuilder> pipelineAggregatorFactories) {
|
Collection<PipelineAggregationBuilder> pipelineAggregatorFactories) {
|
||||||
if (bucketsPaths.length != 1) {
|
if (bucketsPaths.length != 1) {
|
||||||
throw new IllegalStateException(PipelineAggregator.Parser.BUCKETS_PATH.getPreferredName()
|
throw new IllegalStateException(PipelineAggregator.Parser.BUCKETS_PATH.getPreferredName()
|
||||||
|
|
|
@ -144,7 +144,7 @@ public class BucketSortPipelineAggregationBuilder extends AbstractPipelineAggreg
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doValidate(AggregatorFactory<?> parent, Collection<AggregationBuilder> aggFactories,
|
public void doValidate(AggregatorFactory parent, Collection<AggregationBuilder> aggFactories,
|
||||||
Collection<PipelineAggregationBuilder> pipelineAggregatoractories) {
|
Collection<PipelineAggregationBuilder> pipelineAggregatoractories) {
|
||||||
if (sorts.isEmpty() && size == null && from == 0) {
|
if (sorts.isEmpty() && size == null && from == 0) {
|
||||||
throw new IllegalStateException("[" + name + "] is configured to perform nothing. Please set either of "
|
throw new IllegalStateException("[" + name + "] is configured to perform nothing. Please set either of "
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class CumulativeSumPipelineAggregationBuilder extends AbstractPipelineAgg
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doValidate(AggregatorFactory<?> parent, Collection<AggregationBuilder> aggFactories,
|
public void doValidate(AggregatorFactory parent, Collection<AggregationBuilder> aggFactories,
|
||||||
Collection<PipelineAggregationBuilder> pipelineAggregatorFactories) {
|
Collection<PipelineAggregationBuilder> pipelineAggregatorFactories) {
|
||||||
if (bucketsPaths.length != 1) {
|
if (bucketsPaths.length != 1) {
|
||||||
throw new IllegalStateException(BUCKETS_PATH.getPreferredName()
|
throw new IllegalStateException(BUCKETS_PATH.getPreferredName()
|
||||||
|
|
|
@ -152,7 +152,7 @@ public class DerivativePipelineAggregationBuilder extends AbstractPipelineAggreg
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doValidate(AggregatorFactory<?> parent, Collection<AggregationBuilder> aggFactories,
|
public void doValidate(AggregatorFactory parent, Collection<AggregationBuilder> aggFactories,
|
||||||
Collection<PipelineAggregationBuilder> pipelineAggregatoractories) {
|
Collection<PipelineAggregationBuilder> pipelineAggregatoractories) {
|
||||||
if (bucketsPaths.length != 1) {
|
if (bucketsPaths.length != 1) {
|
||||||
throw new IllegalStateException(PipelineAggregator.Parser.BUCKETS_PATH.getPreferredName()
|
throw new IllegalStateException(PipelineAggregator.Parser.BUCKETS_PATH.getPreferredName()
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue