flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aljoscha <...@git.apache.org>
Subject [GitHub] flink pull request: Timer coalescing across keys and cleanup of un...
Date Fri, 29 Apr 2016 12:16:07 GMT
Github user aljoscha commented on a diff in the pull request:

    --- Diff: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperator.java
    @@ -542,14 +561,24 @@ public void registerEventTimeTimer(long time) {
     				// immediately schedule a trigger, so that we don't wait for the next
     				// watermark update to fire the watermark trigger
     				getRuntimeContext().registerTimer(System.currentTimeMillis(), WindowOperator.this);
    +				//No need to put it in processingTimeTimerFutures as this timer is never removed
     		public void deleteProcessingTimeTimer(long time) {
     			Timer<K, W> timer = new Timer<>(time, key, window);
    -			if (processingTimeTimers.remove(timer)) {
    -				processingTimeTimersQueue.remove(timer);
    +			processingTimeTimers.remove(timer);
    +			processingTimeTimersQueue.remove(timer);
    +			//If there are no timers left for this timestamp, remove it from queue and cancel
    +			if (processingTimeTimerTimestamps.remove(time,1) == 1) {
    +				ScheduledFuture<?> triggerTaskFuture = processingTimeTimerFutures.get(timer);
    --- End diff --
    This should be replaced by `processingTimeTimerFutures.remove(timer.time)`. The key in
`processingTimeTimerFutures` is a `long` timestamp. This way, we also don't need to call remove
inside the if and only have one lookup.

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