Hi,

My app is calculating Companies scores from Ratings given by users.
Only ratings from last 90 days should be considered.

1. Is it possible to construct window processing ratings from last 90 days?
I've started with *misusing* countWindow but this solution looks ugly for
me.

ratingStream
  .filter(new OutdatedRatingsFilter(maxRatingAge))
  .keyBy(_.companyId)
  .countWindow(0L).trigger(new OnEventTrigger).evictor(new
OutdatedRatingsEvictor(maxRatingAge))
  .process(ratingFunction)


2. How to recalculate score once the rating expires (after 90 days)?
I don't want to put artificial ratings into the stream to trigger the
recalculation.

Any idea how can I do it better?

Regards,
Krzysztof

Reply via email to