Class PipelineAggregationBuilder
java.lang.Object
org.elasticsearch.search.aggregations.PipelineAggregationBuilder
- All Implemented Interfaces:
NamedWriteable,Writeable,org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentFragment,Rewriteable<PipelineAggregationBuilder>,BaseAggregationBuilder
- Direct Known Subclasses:
AbstractPipelineAggregationBuilder
public abstract class PipelineAggregationBuilder extends java.lang.Object implements NamedWriteable, BaseAggregationBuilder, org.elasticsearch.common.xcontent.ToXContentFragment, Rewriteable<PipelineAggregationBuilder>
A factory that knows how to create an
PipelineAggregator of a
specific type.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPipelineAggregationBuilder.ValidationContextNested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields Modifier and Type Field Description protected java.lang.String[]bucketsPathsprotected java.lang.Stringname -
Constructor Summary
Constructors Modifier Constructor Description protectedPipelineAggregationBuilder(java.lang.String name, java.lang.String[] bucketsPaths)Constructs a new pipeline aggregator factory. -
Method Summary
Modifier and Type Method Description protected abstract PipelineAggregatorcreate()Creates the pipeline aggregatorjava.lang.String[]getBucketsPaths()Return the consumed buckets paths.java.lang.StringgetName()Return this aggregation's name.PipelineAggregationBuilderrewrite(QueryRewriteContext context)Rewrites this instance based on the provided context.abstract PipelineAggregationBuildersetMetadata(java.util.Map<java.lang.String,java.lang.Object> metadata)Associate metadata with thisPipelineAggregationBuilder.PipelineAggregationBuildersubAggregations(AggregatorFactories.Builder subFactories)Set the sub aggregations if this aggregation supports sub aggregations.java.lang.StringtoString()protected abstract voidvalidate(PipelineAggregationBuilder.ValidationContext context)Makes sure this builder is properly configured.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.search.aggregations.BaseAggregationBuilder
getType
-
Field Details
-
name
protected final java.lang.String name -
bucketsPaths
protected final java.lang.String[] bucketsPaths
-
-
Constructor Details
-
PipelineAggregationBuilder
protected PipelineAggregationBuilder(java.lang.String name, java.lang.String[] bucketsPaths)Constructs a new pipeline aggregator factory.- Parameters:
name- The aggregation name
-
-
Method Details
-
getName
public java.lang.String getName()Return this aggregation's name. -
getBucketsPaths
public final java.lang.String[] getBucketsPaths()Return the consumed buckets paths. -
validate
Makes sure this builder is properly configured. -
create
Creates the pipeline aggregator- Returns:
- The created aggregator
-
setMetadata
public abstract PipelineAggregationBuilder setMetadata(java.util.Map<java.lang.String,java.lang.Object> metadata)Associate metadata with thisPipelineAggregationBuilder.- Specified by:
setMetadatain interfaceBaseAggregationBuilder
-
subAggregations
Description copied from interface:BaseAggregationBuilderSet the sub aggregations if this aggregation supports sub aggregations. Returnsthisfor chaining.- Specified by:
subAggregationsin interfaceBaseAggregationBuilder
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
rewrite
Rewrites this instance based on the provided context. The returned objects will be the same instance as this if no changes during the rewrite were applied.The default implementation return the same instance. It should be overridden by aggregations that must load data before they can be run, particularly if that load must by asynchronous.
- Specified by:
rewritein interfaceRewriteable<PipelineAggregationBuilder>- Throws:
java.io.IOException
-