Class AggregatorFactory
java.lang.Object
org.elasticsearch.search.aggregations.AggregatorFactory
- Direct Known Subclasses:
AdjacencyMatrixAggregatorFactory,FilterAggregatorFactory,FiltersAggregatorFactory,GlobalAggregatorFactory,MultiValuesSourceAggregatorFactory,NestedAggregatorFactory,ReverseNestedAggregatorFactory,SamplerAggregatorFactory,SignificantTextAggregatorFactory,ValuesSourceAggregatorFactory
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AggregationContextprotected AggregatorFactoriesprotected Stringprotected AggregatorFactory -
Constructor Summary
ConstructorsConstructorDescriptionAggregatorFactory(String name, AggregationContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String,Object> metadata)Constructs a new aggregator factory. -
Method Summary
Modifier and TypeMethodDescriptioncreate(Aggregator parent, CardinalityUpperBound cardinality)Creates the aggregator.protected abstract AggregatorcreateInternal(Aggregator parent, CardinalityUpperBound cardinality, Map<String,Object> metadata)voidReturns the aggregation subtype for nodes usage stats.name()
-
Field Details
-
name
-
parent
-
factories
-
metadata
-
context
-
-
Constructor Details
-
AggregatorFactory
public AggregatorFactory(String name, AggregationContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String,Object> metadata) throws IOExceptionConstructs a new aggregator factory.- Parameters:
name- The aggregation name- Throws:
IOException- if an error occurs creating the factory
-
-
Method Details
-
name
-
doValidate
public void doValidate() -
createInternal
protected abstract Aggregator createInternal(Aggregator parent, CardinalityUpperBound cardinality, Map<String,Object> metadata) throws IOException- Throws:
IOException
-
create
public final Aggregator create(Aggregator parent, CardinalityUpperBound cardinality) throws IOExceptionCreates the aggregator.- Parameters:
parent- The parent aggregator (if this is a top level factory, the parent will benull)cardinality- Upper bound of the number ofowningBucketOrds that theAggregatorcreated by this method will be asked to collect.- Throws:
IOException
-
getParent
-
getStatsSubtype
Returns the aggregation subtype for nodes usage stats.It should match the types registered by calling AggregationUsageService. In other words, it should be ValueSourcesType for the VST aggregations OTHER_SUBTYPE for all other aggregations.
-