flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl0u <...@git.apache.org>
Subject [GitHub] flink pull request #2278: [FLINK-4239] Set Default Allowed Lateness to Zero ...
Date Mon, 25 Jul 2016 13:47:11 GMT
Github user kl0u commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2278#discussion_r72065711
  
    --- Diff: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/windowing/triggers/PurgingTrigger.java
---
    @@ -44,39 +44,36 @@ private  PurgingTrigger(Trigger<T, W> nestedTrigger) {
     	@Override
     	public TriggerResult onElement(T element, long timestamp, W window, TriggerContext ctx)
throws Exception {
     		TriggerResult triggerResult = nestedTrigger.onElement(element, timestamp, window, ctx);
    -		switch (triggerResult) {
    -			case FIRE:
    -				return TriggerResult.FIRE_AND_PURGE;
    -			case FIRE_AND_PURGE:
    -				return TriggerResult.FIRE_AND_PURGE;
    -			default:
    -				return TriggerResult.CONTINUE;
    +		if (triggerResult.isFire()) {
    +			return TriggerResult.FIRE_AND_PURGE;
    +		} else if (triggerResult.isPurge()) {
    +			return TriggerResult.PURGE;
    --- End diff --
    
    Couldn't we simplify it even more like the following:
    `return triggerResult.isFire() ? TriggerResult.FIRE_AND_PURGE : triggerResult;`


---
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.
---

Mime
View raw message