Class AggregatorFactory

Direct Known Subclasses:
AdjacencyMatrixAggregatorFactory, FilterAggregatorFactory, FiltersAggregatorFactory, GlobalAggregatorFactory, MultiValuesSourceAggregatorFactory, NestedAggregatorFactory, ReverseNestedAggregatorFactory, SamplerAggregatorFactory, SignificantTextAggregatorFactory, ValuesSourceAggregatorFactory

public abstract class AggregatorFactory
extends java.lang.Object
  • Field Details

    • name

      protected final java.lang.String name
    • parent

      protected final AggregatorFactory parent
    • factories

      protected final AggregatorFactories factories
    • metadata

      protected final java.util.Map<java.lang.String,​java.lang.Object> metadata
    • context

      protected final AggregationContext context
  • 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
      Constructs a new aggregator factory.
      name - The aggregation name
      Throws: - 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
    • create

      public final Aggregator create​(Aggregator parent, CardinalityUpperBound cardinality) throws
      Creates the aggregator.
      parent - The parent aggregator (if this is a top level factory, the parent will be null)
      cardinality - Upper bound of the number of owningBucketOrds that the Aggregator created by this method will be asked to collect.
    • getParent

      public AggregatorFactory 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.