Hello Ryan,

On the DSL layer, currently there is not support for record window yet; and
we are discussing about adding such support in the future, maybe first
session windows then others.

On the Processor API layer, you can definitely implement this "record
window" feature yourself by keeping track of the most recent 10 records in
a state store, and upon each new incoming record, delete the oldest record
and insert this new record, and re-compute the count (for your specific
case you do not need to re-scan all 10 records, but just get the new counts
as

old counts + (if new record > 100) ? 1 : 0 - (if old record > 100) ? 1 : 0


Guozhang


On Thu, Jun 23, 2016 at 1:55 PM, Ryan Thompson <[email protected]>
wrote:

> Hello,
>
> Say I have a stream, and want to determine whether or not a given "density"
> of of records match a given condition.  For example, let's say I want to
> how many of the last 10 records have a numerical value greater than 100.
>
> Does the kafka streams DSL (or processor API) provide a way to do this type
> of aggregation in a way that supports out of order messages?
>
> I can't use a time window based aggregation here because my window is based
> on a quantity of records (in this case, the last 10) rather than time.
> However, I still want to know about the last 10 records regardless of what
> order they arrive.
>
> Thanks,
> Ryan
>



-- 
-- Guozhang

Reply via email to