Class AggregateConsumer

All Implemented Interfaces:
SampleConsumer, SampleProcessor, SampleProducer

public class AggregateConsumer extends AbstractSampleConsumer
The Class AggregateConsumer provides a consumer that can aggregate samples to provide a result
Since:
3.0
  • Constructor Details

    • AggregateConsumer

      public AggregateConsumer(Aggregator aggregator, SampleSelector<Double> selector)
      Instantiates a new abstract aggregate consumer.
      Parameters:
      aggregator - the aggregator (must not be null)
      selector - the selector (must not be null)
  • Method Details

    • getAggregator

      public final Aggregator getAggregator()
      Gets the aggregator.
      Returns:
      the aggregator
    • getSelector

      public final SampleSelector<Double> getSelector()
      Gets the selector.
      Returns:
      the selector
    • startConsuming

      public void startConsuming()
      Description copied from interface: SampleConsumer
      Start the sample consuming. This step is used by consumer to initialize their process.
    • consume

      public void consume(Sample sample, int channel)
      Description copied from interface: SampleConsumer
      Consumes the specified sample ton the specified channel.
      Parameters:
      sample - The sample to be consumed
      channel - The channel on which the sample is consumed
    • stopConsuming

      public void stopConsuming()
      Description copied from interface: SampleConsumer
      Stops the consuming process. No sample will be processed after this service has been called.