Hello all,
Here's a code comment from
org.apache.flink.streaming.api.windowing.triggers.Trigger:
/**
* Result type for trigger methods. This determines what happens
which the window.
*
* <p>
* On {@code FIRE} the pane is evaluated and results are emitted. *The
contents of the window*
* *are kept*. {@code FIRE_AND_PURGE} acts like {@code FIRE} but
the contents of the pane
* are purged. On {@code CONTINUE} nothing happens, processing
continues. On {@code PURGE}
* the contents of the window are discarded and now result is
emitted for the window.
*/
And, here's the code snippet from
org.apache.flink.streaming.api.windowing.triggers.CountTrigger:
@Override
public TriggerResult onElement(Object element, long timestamp, W
window, TriggerContext ctx) throws IOException {
OperatorState<Long> count = ctx.getKeyValueState("count",
0L);
long currentCount = count.value() + 1;
count.update(currentCount);
if (currentCount >= maxCount) {
count.update(0L);
return TriggerResult.FIRE;
}
return TriggerResult.CONTINUE;
}
Following the code-comment, I understand that elements are *not* *PURGE*d
from a CountWindow, only *FIRE*d. The contents on the Window stay *forever*.
Now, that is counter-intuitive to me. Something is not right about this.
What am I missing? Help me to plug the holes in my understanding.
-- Nirmalya
--
Software Technologist
http://www.linkedin.com/in/nirmalyasengupta
"If you have built castles in the air, your work need not be lost. That is
where they should be.
Now put the foundation under them."