Skip to content

Commit

Permalink
[FLINK-4866] [streaming] Make Trigger.clear() Abstract to Enforce Imp…
Browse files Browse the repository at this point in the history
…lementation
  • Loading branch information
wuchong authored and aljoscha committed Oct 24, 2016
1 parent b0753f1 commit 2c20b39
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,8 @@ public TriggerResult onMerge(W window, OnMergeContext ctx) throws Exception {
* when a window is purged. Timers set using {@link TriggerContext#registerEventTimeTimer(long)}
* and {@link TriggerContext#registerProcessingTimeTimer(long)} should be deleted here as
* well as state acquired using {@link TriggerContext#getPartitionedState(StateDescriptor)}.
*
* <p>By default, this method does nothing.
*/
public void clear(W window, TriggerContext ctx) throws Exception {}
public abstract void clear(W window, TriggerContext ctx) throws Exception;

// ------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,9 @@ public TriggerResult onEventTime(long time,
public boolean canMerge() {
return false;
}

@Override
public void clear(TimeWindow window, TriggerContext ctx) throws Exception {}
});
} catch (UnsupportedOperationException e) {
// expected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ public TriggerResult onEventTime(long time,
public boolean canMerge() {
return false;
}

@Override
public void clear(TimeWindow window, TriggerContext ctx) throws Exception {}
});
} catch (UnsupportedOperationException e) {
// expected
Expand Down

0 comments on commit 2c20b39

Please sign in to comment.