Skip to content

KStreamAggregateProcessor

KStreamAggregateProcessor is an AbstractProcessor of KStreamAggregate.

Creating Instance

KStreamAggregateProcessor takes no arguments to be created.

KStreamAggregateProcessor is created when:

  • KStreamAggregate is requested for a Processor

KStreamAggregate

KStreamAggregateProcessor is a private class of KStreamAggregate and so have access to the internal properties (e.g. state name) thereof.

TimestampedKeyValueStore

KStreamAggregateProcessor looks up a TimestampedKeyValueStore by the name given when the owning KStreamAggregate was created.

The TimestampedKeyValueStore is used for the following:

TimestampedTupleForwarder

KStreamAggregateProcessor creates a new TimestampedTupleForwarder when created.

The TimestampedTupleForwarder is used when processing a record.

Initializing

void init(
  ProcessorContext context)

init...FIXME

init is part of the AbstractProcessor abstraction.

Processing Record

void process(
  K key, 
  V value)

process requests the TimestampedKeyValueStore for the value for the input key (that gives a ValueAndTimestamp if found).

With no previous value found, process requests the parent's Initializer for the initial value and the ProcessorContext for the timestamp.

process requests the parent's Aggregator for a new aggregate for the input key and value (and the previous or newly-created aggregation).

process creates a new ValueAndTimestamp with the new aggregate and the timestamp and requests the TimestampedKeyValueStore to store it (for the key).

In the end, process requests the TimestampedTupleForwarder to maybeForward.


process is part of the AbstractProcessor abstraction.

Back to top