-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Disable combiner lifting only for count triggers #37715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -126,6 +126,12 @@ public boolean mayFinish() { | |||||||||||||||||||||
| return lateTrigger == null; | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| @Override | ||||||||||||||||||||||
| public boolean isCompatibleWithCombinerLifting() { | ||||||||||||||||||||||
| return earlyTrigger.isCompatibleWithCombinerLifting() | ||||||||||||||||||||||
| && (lateTrigger == null || lateTrigger.isCompatibleWithCombinerLifting()); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
Comment on lines
130
to
133
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This implementation can cause a public boolean isCompatibleWithCombinerLifting() {
return subTriggers.stream().allMatch(Trigger::isCompatibleWithCombinerLifting);
}
Comment on lines
+129
to
+133
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For consistency with other composite triggers like
Suggested change
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| @Override | ||||||||||||||||||||||
| public String toString() { | ||||||||||||||||||||||
| StringBuilder builder = new StringBuilder(TO_STRING); | ||||||||||||||||||||||
|
|
@@ -177,6 +183,11 @@ protected FromEndOfWindow getContinuationTrigger(List<Trigger> continuationTrigg | |||||||||||||||||||||
| return this; | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| @Override | ||||||||||||||||||||||
| public boolean isCompatibleWithCombinerLifting() { | ||||||||||||||||||||||
| return true; | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| @Override | ||||||||||||||||||||||
| public String toString() { | ||||||||||||||||||||||
| return TO_STRING; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -64,6 +64,12 @@ public boolean mayFinish() { | |||||||||||||||||||||
| return subTriggers.get(ACTUAL).mayFinish() || subTriggers.get(UNTIL).mayFinish(); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| @Override | ||||||||||||||||||||||
| public boolean isCompatibleWithCombinerLifting() { | ||||||||||||||||||||||
| return subTriggers.get(ACTUAL).isCompatibleWithCombinerLifting() | ||||||||||||||||||||||
| && subTriggers.get(UNTIL).isCompatibleWithCombinerLifting(); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
Comment on lines
+67
to
+71
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For consistency with other composite triggers, you could use a stream over
Suggested change
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| @Override | ||||||||||||||||||||||
| protected Trigger getContinuationTrigger(List<Trigger> continuationTriggers) { | ||||||||||||||||||||||
| // Use OrFinallyTrigger instead of AfterFirst because the continuation of ACTUAL | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this method should be part of the DataflowRunner not the trigger. Whether the needed metadata is available is a property of how the runner executes the trigger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making it part of the Trigger does ensure that we don't accidentally miss a trigger (in case one gets added). I guess we could check this at runtime or we could create a TriggerVisitor (which will ensure no cases are missed at compile time)?