flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxm <...@git.apache.org>
Subject [GitHub] flink pull request #2671: [FLINK-4862] fix Timer register in ContinuousEvent...
Date Fri, 21 Oct 2016 13:16:16 GMT
Github user mxm commented on a diff in the pull request:

    --- Diff: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/windowing/triggers/ContinuousEventTimeTrigger.java
    @@ -88,9 +96,13 @@ public TriggerResult onProcessingTime(long time, W window, TriggerContext
ctx) t
     	public void clear(W window, TriggerContext ctx) throws Exception {
     		ReducingState<Long> fireTimestamp = ctx.getPartitionedState(stateDesc);
    -		long timestamp = fireTimestamp.get();
    -		ctx.deleteEventTimeTimer(timestamp);
    -		fireTimestamp.clear();
    +		Long timestamp = fireTimestamp.get();
    +		if (timestamp != null) {
    +			ctx.deleteEventTimeTimer(timestamp);
    +			fireTimestamp.clear();
    +		} else if (cachedFireTimestamp != null){
    +			ctx.deleteEventTimeTimer(cachedFireTimestamp);
    +		}
    --- End diff --
    The above `else if` block is not correct because there is only one instance of the trigger
which is reused for each Window. Hence the abstraction using the state descriptor to retrieve
the appropriate state.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message