snuyanzin commented on code in PR #26434:
URL: https://github.com/apache/flink/pull/26434#discussion_r2425544261
##########
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:
>The overhead of getBoundedness is not definite.
then the question still remains
>why do we need it?
the checks for instanceof and getBoundedness are cheap
--
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]