Aljoscha Krettek created FLINK-4415: ---------------------------------------
Summary: Enhance Trigger Interface with onFire() and onCleanup() Key: FLINK-4415 URL: https://issues.apache.org/jira/browse/FLINK-4415 Project: Flink Issue Type: Sub-task Components: Streaming Reporter: Aljoscha Krettek Currently, when a {{Trigger}} returns {{PURGE}} (or {{FIRE_AND_PURGE}}) the window state, trigger state and timer state are completely deleted. Some use cases might only want to have the window contents deleted. In addition, triggers have no way of reacting to garbage collection, i.e. the time when allowed lateness expires and we completely clean up everything. I want to propose to add these two new methods: {code} void onFire(...) boolean onCleanup(...) {code} The {{onFire()}} is called when a window fires and we emit data. This gives the trigger the chance to reset/cleanup state. {{onCleanup()}} gives the trigger the chance to emit one final result before everything is purged, and also allows to cleanup data, i.e. it also replaces {{clear()}}. The window operator will not purge window state and timers anymore but call {{Trigger.onFire()}} to give it a chance to decide whether to delete state and timers. -- This message was sent by Atlassian JIRA (v6.3.4#6332)