nathanmarz/storm-starter — pull request #33 by MichaelBlume (2013-01-22 21:07:44+00:00)
Title: Ensure zeros get reported.

This change is best explained by describing the behavior of
RollingTopWords in its absence.

Let's say the word "Bieber" appears in the tweet stream at a very high
rate for half an hour, and then is *never heard again*.

This will insert the word "Bieber" into our rankings object downstream.

Note that there is nothing to *remove* the word "Bieber" from the
rankings object downstream. Let us assume that, during its half-hour,
the word "Bieber" appears *more than five times as often* as other
highly-ranked words. Then the very *last* "Bieber" report (in which
"Bieber" has only appeared for the first minute of the five-minute
window) will still be able to hold a place in the rankings. Objects are
only lowered in the rankings by being outranked, or by *appearing again*
with a lower score.

*With* this change, we wipe zeros, and *then* wipe a slot. This means
that when we wipe the slot containing the last Bieber mentions, we
don't at that moment remove "Bieber" from our map. The *next* report
will include "Bieber" with a score of zero, removing "Bieber" from the
ranking object downstream.