Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
Description
Summary:
Javadoc for ProcessWindowFunction has incorrect (outdated) information.
Description:
The current javadoc for ProcessWindowFunction clear method says
Deletes any state in the Context when the Window is purged.
But, this is not true anymore. This behavior was changed in FLINK-4994.
Before FLINK-4994, when Trigger.PURGE was called, it would invoke ProcessWindowFunction's clear( ) method to clean up all keyed per-window state.
But after FLINK-4994, ProcessWindowFunction's clear is called only when the window expires, which is to say the window reaches its window.maxTimestamp.
This change in behavior comes from this code change (repeated in a few other places) in FLINK-4994.
Proposed change:
I think we should change the description to say
Deletes any state in the Context when the Window expires (reaches its maxTimestamp).
Why this can be helpful:
The current documentation could be misleading. Developers will assume that the keyed per-window state will get cleared when a PURGE executes. But that won't happen. I myself had to go through flink source code to identify the disconnect. Updating the javadoc can help future users to avoid such confusions.
Links to lines of code that will need updating:
- ProcessWindowFunction.scala
- ProcessAllWindowFunction.scala
- ProcessWindowFunction.java
- ProcessAllWindowFunction.java
- InternalWindowFunction.java
I have a PR ready, which I can put out once the ticket is approved / assigned.
Attachments
Issue Links
- links to