public abstract class AggregatorFactory extends Object
Aggregator
of a specific type.Modifier and Type | Field and Description |
---|---|
protected AggregatorFactories |
factories |
protected Map<String,Object> |
metaData |
protected String |
name |
protected AggregatorFactory |
parent |
protected String |
type |
Constructor and Description |
---|
AggregatorFactory(String name,
String type)
Constructs a new aggregator factory.
|
Modifier and Type | Method and Description |
---|---|
protected static Aggregator |
asMultiBucketAggregator(AggregatorFactory factory,
AggregationContext context,
Aggregator parent)
Utility method.
|
Aggregator |
create(AggregationContext context,
Aggregator parent,
boolean collectsFromSingleBucket)
Creates the aggregator
|
protected abstract Aggregator |
createInternal(AggregationContext context,
Aggregator parent,
boolean collectsFromSingleBucket,
List<PipelineAggregator> pipelineAggregators,
Map<String,Object> metaData) |
void |
doValidate() |
String |
name() |
AggregatorFactory |
parent() |
void |
setMetaData(Map<String,Object> metaData) |
AggregatorFactory |
subFactories(AggregatorFactories subFactories)
Registers sub-factories with this factory.
|
void |
validate()
Validates the state of this factory (makes sure the factory is properly configured)
|
protected String name
protected String type
protected AggregatorFactory parent
protected AggregatorFactories factories
public AggregatorFactory subFactories(AggregatorFactories subFactories)
subFactories
- The sub-factoriespublic String name()
public final void validate()
public AggregatorFactory parent()
null
for top level aggregator factories).protected abstract Aggregator createInternal(AggregationContext context, Aggregator parent, boolean collectsFromSingleBucket, List<PipelineAggregator> pipelineAggregators, Map<String,Object> metaData) throws IOException
IOException
public final Aggregator create(AggregationContext context, Aggregator parent, boolean collectsFromSingleBucket) throws IOException
context
- The aggregation contextparent
- The parent aggregator (if this is a top level factory, the parent will be null
)collectsFromSingleBucket
- If true then the created aggregator will only be collected with 0 as a bucket ordinal.
Some factories can take advantage of this in order to return more optimized implementations.IOException
public void doValidate()
protected static Aggregator asMultiBucketAggregator(AggregatorFactory factory, AggregationContext context, Aggregator parent) throws IOException
AggregatorFactory
that creates Aggregator
s that only know how
to collect bucket 0, this returns an aggregator that can collect any bucket.IOException
Copyright © 2009–2017. All rights reserved.