beliefer commented on code in PR #26434:
URL: https://github.com/apache/flink/pull/26434#discussion_r2425600862
##########
flink-runtime/src/main/java/org/apache/flink/streaming/api/graph/StreamGraphGenerator.java:
##########
@@ -438,16 +439,26 @@ private boolean shouldExecuteInBatchMode() {
}
private boolean existsUnboundedSource() {
+ final HashSet<Integer> checkedTransformations = new HashSet<>();
return transformations.stream()
.anyMatch(
transformation ->
- isUnboundedSource(transformation)
+ isUnboundedSource(transformation,
checkedTransformations)
||
transformation.getTransitivePredecessors().stream()
-
.anyMatch(this::isUnboundedSource));
+ .anyMatch(
+ t ->
+
isUnboundedSource(
+ t,
+
checkedTransformations)));
}
- private boolean isUnboundedSource(final Transformation<?> transformation) {
+ private boolean isUnboundedSource(
+ final Transformation<?> transformation, HashSet<Integer>
checkedTransformations) {
checkNotNull(transformation);
+ if (checkedTransformations.contains(transformation.getId())) {
+ return false;
+ }
+ checkedTransformations.add(transformation.getId());
Review Comment:
Yes, I hope to avoid duplicate checks when `getBoundedness`'s cost is
uncertain.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]