Class AggregatorFactory
java.lang.Object
org.elasticsearch.search.aggregations.AggregatorFactory
- Direct Known Subclasses:
AdjacencyMatrixAggregatorFactory
,FilterAggregatorFactory
,FiltersAggregatorFactory
,GlobalAggregatorFactory
,MultiValuesSourceAggregatorFactory
,NestedAggregatorFactory
,ReverseNestedAggregatorFactory
,SamplerAggregatorFactory
,SignificantTextAggregatorFactory
,ValuesSourceAggregatorFactory
public abstract class AggregatorFactory
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description protected AggregationContext
context
protected AggregatorFactories
factories
protected java.util.Map<java.lang.String,java.lang.Object>
metadata
protected java.lang.String
name
protected AggregatorFactory
parent
-
Constructor Summary
Constructors Constructor Description AggregatorFactory(java.lang.String name, AggregationContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metadata)
Constructs a new aggregator factory. -
Method Summary
Modifier and Type Method Description Aggregator
create(Aggregator parent, CardinalityUpperBound cardinality)
Creates the aggregator.protected abstract Aggregator
createInternal(Aggregator parent, CardinalityUpperBound cardinality, java.util.Map<java.lang.String,java.lang.Object> metadata)
void
doValidate()
AggregatorFactory
getParent()
java.lang.String
getStatsSubtype()
Returns the aggregation subtype for nodes usage stats.java.lang.String
name()
-
Field Details
-
Constructor Details
-
AggregatorFactory
public AggregatorFactory(java.lang.String name, AggregationContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metadata) throws java.io.IOExceptionConstructs a new aggregator factory.- Parameters:
name
- The aggregation name- Throws:
java.io.IOException
- if an error occurs creating the factory
-
-
Method Details
-
name
public java.lang.String name() -
doValidate
public void doValidate() -
createInternal
protected abstract Aggregator createInternal(Aggregator parent, CardinalityUpperBound cardinality, java.util.Map<java.lang.String,java.lang.Object> metadata) throws java.io.IOException- Throws:
java.io.IOException
-
create
public final Aggregator create(Aggregator parent, CardinalityUpperBound cardinality) throws java.io.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 ofowningBucketOrd
s that theAggregator
created by this method will be asked to collect.- Throws:
java.io.IOException
-
getParent
-
getStatsSubtype
public java.lang.String 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.
-